From d0c2fbd858b8a1112975ebaa43e229cd6029fe44 Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 25 May 2003 22:33:03 +0000 Subject: [PATCH] merged dll handling code into sys_shared.c because the code in sys_linux.c was for both windows and linux, no real point in separating them git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3034 d7cf8633-e32d-0410-b094-e92efae38249 --- sys_linux.c | 35 ----------------------------------- sys_shared.c | 39 +++++++++++++++++++++++++++++++++++++++ sys_win.c | 26 -------------------------- 3 files changed, 39 insertions(+), 61 deletions(-) diff --git a/sys_linux.c b/sys_linux.c index e63d6a7a..2cda9072 100644 --- a/sys_linux.c +++ b/sys_linux.c @@ -5,7 +5,6 @@ #include #include #include -#include #endif #include @@ -17,40 +16,6 @@ cvar_t sys_usetimegettime = {CVAR_SAVE, "sys_usetimegettime", "1"}; #endif -/* -=============================================================================== - -DLL MANAGEMENT - -=============================================================================== -*/ - -dllhandle_t Sys_LoadLibrary (const char* name) -{ -#ifdef WIN32 - return LoadLibrary (name); -#else - return dlopen (name, RTLD_LAZY); -#endif -} - -void Sys_UnloadLibrary (dllhandle_t handle) -{ -#ifdef WIN32 - FreeLibrary (handle); -#else - dlclose (handle); -#endif -} - -void* Sys_GetProcAddress (dllhandle_t handle, const char* name) -{ -#ifdef WIN32 - return (void *)GetProcAddress (handle, name); -#else - return (void *)dlsym (handle, name); -#endif -} // ======================================================================= diff --git a/sys_shared.c b/sys_shared.c index 3d666e92..465b322e 100644 --- a/sys_shared.c +++ b/sys_shared.c @@ -118,3 +118,42 @@ void Sys_Shared_LateInit(void) { } +/* +=============================================================================== + +DLL MANAGEMENT + +=============================================================================== +*/ + +#ifndef WIN32 +#include +#endif + +dllhandle_t Sys_LoadLibrary (const char* name) +{ +#ifdef WIN32 + return LoadLibrary (name); +#else + return dlopen (name, RTLD_LAZY); +#endif +} + +void Sys_UnloadLibrary (dllhandle_t handle) +{ +#ifdef WIN32 + FreeLibrary (handle); +#else + dlclose (handle); +#endif +} + +void* Sys_GetProcAddress (dllhandle_t handle, const char* name) +{ +#ifdef WIN32 + return (void *)GetProcAddress (handle, name); +#else + return (void *)dlsym (handle, name); +#endif +} + diff --git a/sys_win.c b/sys_win.c index ae3f7cd4..d9b013b0 100644 --- a/sys_win.c +++ b/sys_win.c @@ -35,8 +35,6 @@ cvar_t sys_usetimegettime = {CVAR_SAVE, "sys_usetimegettime", "1"}; // sleep time when not focus #define NOT_FOCUS_SLEEP 20 -int starttime; - static qboolean sc_return_on_enter = false; HANDLE hinput, houtput; @@ -46,30 +44,6 @@ static HANDLE heventParent; static HANDLE heventChild; -/* -=============================================================================== - -DLL MANAGEMENT - -=============================================================================== -*/ - -dllhandle_t Sys_LoadLibrary (const char* name) -{ - return LoadLibrary (name); -} - -void Sys_UnloadLibrary (dllhandle_t handle) -{ - FreeLibrary (handle); -} - -void* Sys_GetProcAddress (dllhandle_t handle, const char* name) -{ - return (void *)GetProcAddress (handle, name); -} - - /* =============================================================================== -- 2.39.2