]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
added SUPPORTDLL define and checks, if any platforms lack support for
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 21 Dec 2009 08:53:48 +0000 (08:53 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 21 Dec 2009 08:53:48 +0000 (08:53 +0000)
dynamic loading they could alter this define

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9620 d7cf8633-e32d-0410-b094-e92efae38249

sys_shared.c

index 683fe0b13aba7b008e1373ed019ac0a3d6e04374..a52b9426cd5b769b36e08a88c86c1f31a04f9042 100644 (file)
@@ -1,10 +1,15 @@
 #include "quakedef.h"
+
+#define SUPPORTDLL
+
 # include <time.h>
 #ifndef WIN32
 # include <unistd.h>
 # include <fcntl.h>
+#ifdef SUPPORTDLL
 # include <dlfcn.h>
 #endif
+#endif
 
 static char sys_timestring[128];
 char *Sys_TimeString(const char *timeformat)
@@ -56,6 +61,7 @@ DLL MANAGEMENT
 
 qboolean Sys_LoadLibrary (const char** dllnames, dllhandle_t* handle, const dllfunction_t *fcts)
 {
+#ifdef SUPPORTDLL
        const dllfunction_t *func;
        dllhandle_t dllhandle = 0;
        unsigned int i;
@@ -143,10 +149,14 @@ notfound:
 
        *handle = dllhandle;
        return true;
+#else
+       return false;
+#endif
 }
 
 void Sys_UnloadLibrary (dllhandle_t* handle)
 {
+#ifdef SUPPORTDLL
        if (handle == NULL || *handle == NULL)
                return;
 
@@ -157,14 +167,19 @@ void Sys_UnloadLibrary (dllhandle_t* handle)
 #endif
 
        *handle = NULL;
+#endif
 }
 
 void* Sys_GetProcAddress (dllhandle_t handle, const char* name)
 {
+#ifdef SUPPORTDLL
 #ifdef WIN32
        return (void *)GetProcAddress (handle, name);
 #else
        return (void *)dlsym (handle, name);
 #endif
+#else
+       return NULL;
+#endif
 }