]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_shared.c
changed Cg shader support to check DP_CG_LIBDIR instead of trying to
[xonotic/darkplaces.git] / 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
 }