From 425decdf7e9284d15aa726e3ae96b9942fb0e3ea Mon Sep 17 00:00:00 2001 From: IronClawTrem Date: Sun, 16 Feb 2020 03:40:06 +0000 Subject: create tremded branch --- src/sys/sys_loadlib.h | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/sys/sys_loadlib.h (limited to 'src/sys/sys_loadlib.h') diff --git a/src/sys/sys_loadlib.h b/src/sys/sys_loadlib.h new file mode 100644 index 0000000..10baebc --- /dev/null +++ b/src/sys/sys_loadlib.h @@ -0,0 +1,57 @@ +/* +=========================================================================== +Copyright (C) 1999-2005 Id Software, Inc. +Copyright (C) 2000-2013 Darklegion Development +Copyright (C) 2015-2019 GrangerHub + +This file is part of Tremulous. + +Tremulous is free software; you can redistribute it +and/or modify it under the terms of the GNU General Public License as +published by the Free Software Foundation; either version 3 of the License, +or (at your option) any later version. + +Tremulous is distributed in the hope that it will be +useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Tremulous; if not, see + +=========================================================================== +*/ +#ifndef _SYS_LOADLIB_H_ +#define _SYS_LOADLIB_H_ + +#ifdef DEDICATED +# ifdef _WIN32 +# include +# define Sys_LoadLibrary(f) (void*)LoadLibrary(f) +# define Sys_UnloadLibrary(h) FreeLibrary((HMODULE)h) +# define Sys_LoadFunction(h,fn) (void*)GetProcAddress((HMODULE)h,fn) +# define Sys_LibraryError() "unknown" +# else +# include +# define Sys_LoadLibrary(f) dlopen(f,RTLD_NOW) +# define Sys_UnloadLibrary(h) dlclose(h) +# define Sys_LoadFunction(h,fn) dlsym(h,fn) +# define Sys_LibraryError() dlerror() +# endif +#else +# ifdef USE_LOCAL_HEADERS +# include "SDL.h" +# include "SDL_loadso.h" +# else +# include +# include +# endif +# define Sys_LoadLibrary(f) SDL_LoadObject(f) +# define Sys_UnloadLibrary(h) SDL_UnloadObject(h) +# define Sys_LoadFunction(h,fn) SDL_LoadFunction(h,fn) +# define Sys_LibraryError() SDL_GetError() +#endif + +void * QDECL Sys_LoadDll(const char *name, bool useSystemLib); + +#endif -- cgit