]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/server.cpp
Wrap GtkAccelGroup
[xonotic/netradiant.git] / radiant / server.cpp
index 500cc58e72682aecf8b733d708529bbf6f1072e9..714521c7ec6e14e8abe06706f463a00c38b98c26 100644 (file)
 #include "server.h"
 
 #include "debugging/debugging.h"
-#include "warnings.h"
 
-#include <vector>
 #include <map>
+#include <vector>
 #include "os/path.h"
 
 #include "modulesystem.h"
 
 class RadiantModuleServer : public ModuleServer
 {
-typedef std::pair<CopiedString, int> ModuleType;
-typedef std::pair<ModuleType, CopiedString> ModuleKey;
+typedef std::pair<std::string, int> ModuleType;
+typedef std::pair<ModuleType, std::string> ModuleKey;
 typedef std::map<ModuleKey, Module*> Modules_;
 Modules_ m_modules;
 bool m_error;
@@ -131,7 +130,7 @@ bool failed(){
        return m_library == 0;
 }
 FunctionPointer findSymbol( const char* symbol ){
-       FunctionPointer address = GetProcAddress( m_library, symbol );
+       FunctionPointer address = (FunctionPointer) GetProcAddress( m_library, symbol );
        if ( address == 0 ) {
                globalErrorStream() << "GetProcAddress failed: '" << symbol << "'\n";
                globalErrorStream() << "GetLastError: " << FormatGetLastError();
@@ -151,7 +150,18 @@ public:
 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() ) {