#include "server.h"
#include "debugging/debugging.h"
-#include "warnings.h"
-#include <vector>
#include <map>
+#include <vector>
#include "os/path.h"
#include "modulesystem.h"
typedef int ( *FunctionPointer )();
DynamicLibrary( const char* filename ){
- m_library = dlopen( filename, RTLD_NOW );
+ m_library = dlopen(filename, RTLD_LOCAL
+ | RTLD_NOW
+ #ifndef __APPLE__
+ | RTLD_DEEPBIND
+ #endif
+ );
+ if ( !m_library )
+ {
+ globalErrorStream() << "LoadLibrary failed: '" << filename << "'\n";
+ if ( const char* error = dlerror() )
+ globalErrorStream() << "GetLastError: " << error;
+ }
}
~DynamicLibrary(){
if ( !failed() ) {