8 #ifndef GAUDIKERNEL_DSOUTILS_H 9 #define GAUDIKERNEL_DSOUTILS_H 22 return libName +
".dll";
23 #elif defined( __linux ) || defined( __APPLE__ ) 24 return "lib" + libName +
".so";
36 if ( dladdr( addr, &info ) == 0 )
return "";
38 const char* pos = strrchr( info.dli_fname,
'/' );
45 #elif defined( _WIN32 ) 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& ) {
return ""; }
73 static bool inDso(
void* addr,
const std::string& dsoname )
82 if ( srcname.
empty() ) {
87 std::string::size_type pos = dsoname.
find_last_of( sep );
89 if ( std::string::npos == pos ) {
92 curname = dsoname.
substr( pos + 1 );
95 return srcname == curname;
100 #endif // not GAUDIKERNEL_DSOUTILS_H
std::string libNativeName(const std::string &libName)