From: havoc Date: Mon, 21 Dec 2009 08:53:48 +0000 (+0000) Subject: added SUPPORTDLL define and checks, if any platforms lack support for X-Git-Tag: xonotic-v0.1.0preview~1028 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4b69d6743a52d7471970da0c2473a2a94b042598;p=xonotic%2Fdarkplaces.git added SUPPORTDLL define and checks, if any platforms lack support for dynamic loading they could alter this define git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9620 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/sys_shared.c b/sys_shared.c index 683fe0b1..a52b9426 100644 --- a/sys_shared.c +++ b/sys_shared.c @@ -1,10 +1,15 @@ #include "quakedef.h" + +#define SUPPORTDLL + # include #ifndef WIN32 # include # include +#ifdef SUPPORTDLL # include #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 }