*/
#include "server.h"
+#include "globaldefs.h"
#include "debugging/debugging.h"
#include "warnings.h"
}
void registerModule( const char* type, int version, const char* name, Module& module ){
- ASSERT_NOTNULL( &module );
if ( !m_modules.insert( Modules_::value_type( ModuleKey( ModuleType( type, version ), name ), &module ) ).second ) {
globalErrorStream() << "module already registered: type=" << makeQuoted( type ) << " name=" << makeQuoted( name ) << "\n";
}
};
-#if defined( WIN32 )
+#if GDEF_OS_WINDOWS
#include <windows.h>
-#define FORMAT_BUFSIZE 2048
+const int FORMAT_BUFSIZE = 2048;
const char* FormatGetLastError(){
static char buf[FORMAT_BUFSIZE];
FormatMessage(
}
};
-#elif defined( POSIX )
+#elif GDEF_OS_POSIX
#include <dlfcn.h>
-class DynamicLibrary
-{
-void* m_library;
+#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 )();
}
};
-#else
+#else // !GDEF_OS_POSIX
#error "unsupported platform"
-#endif
+#endif // !GDEF_OS_POSIX
class DynamicLibraryModule
{