8 #ifndef GAUDIKERNEL_DSOUTILS_H
9 #define GAUDIKERNEL_DSOUTILS_H
21 return libName+
".dll";
22 #elif defined(__linux) || defined(__APPLE__)
23 return "lib"+libName+
".so";
32 static std::string dsoName(
void* addr)
35 if (dladdr(addr, &info) == 0)
38 const char* pos = strrchr (info.dli_fname,
'/');
48 static std::string dsoName(
void* addr)
51 MEMORY_BASIC_INFORMATION mbi;
52 if ( VirtualQuery(addr, &mbi,
sizeof(mbi)) ) {
53 HMODULE h_module = (HMODULE)mbi.AllocationBase;
55 if( GetModuleFileName(h_module,
mod,
sizeof(
mod)) ) {
56 const char* pos = strrchr (
mod,
'\\');
68 #else // dummy implementation for unknown platforms
69 static std::string dsoName(
const ROOT::Reflex::Member& )
76 static bool inDso(
void *addr,
const std::string& dsoname)
84 std::string srcname = dsoName(addr);
85 if (srcname.empty()) {
90 std::string::size_type pos = dsoname.find_last_of(sep);
92 if (std::string::npos == pos) {
95 curname = dsoname.substr(pos+1);
98 return srcname == curname;
103 #endif // not GAUDIKERNEL_DSOUTILS_H
std::string libNativeName(const std::string &libName)