#include <dlfcn.h>
+#if GDEF_OS_MACOS
+#ifndef RTLD_DEEPBIND
+#define RTLD_DEEPBIND 0
+#endif // RTLD_DEEPBIND
+#endif // GDEF_OS_MACOS
+
class DynamicLibrary {
void *m_library;
public:
typedef int ( *FunctionPointer )();
DynamicLibrary( const char* filename ){
- m_library = dlopen( filename, RTLD_NOW );
+ m_library = dlopen( filename, RTLD_NOW | (RTLD_DEEPBIND + 0) );
}
~DynamicLibrary(){
if ( !failed() ) {
}
};
-#else
+#else // !GDEF_OS_POSIX
#error "unsupported platform"
-#endif
+#endif // !GDEF_OS_POSIX
class DynamicLibraryModule
{