| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifdef DEDICATED |
| 24 |
# ifdef _WIN32 |
| 25 |
# include <windows.h> |
| 26 |
# define Sys_LoadLibrary(f) (void*)LoadLibrary(f) |
| 27 |
# define Sys_UnloadLibrary(h) FreeLibrary((HMODULE)h) |
| 28 |
# define Sys_LoadFunction(h,fn) (void*)GetProcAddress((HMODULE)h,fn) |
| 29 |
# define Sys_LibraryError() "unknown" |
| 30 |
# else |
| 31 |
# include <dlfcn.h> |
| 32 |
# define Sys_LoadLibrary(f) dlopen(f,RTLD_NOW) |
| 33 |
# define Sys_UnloadLibrary(h) dlclose(h) |
| 34 |
# define Sys_LoadFunction(h,fn) dlsym(h,fn) |
| 35 |
# define Sys_LibraryError() dlerror() |
| 36 |
# endif |
| 37 |
#else |
| 38 |
# ifdef USE_INTERNAL_SDL_HEADERS |
| 39 |
# include "SDL.h" |
| 40 |
# include "SDL_loadso.h" |
| 41 |
# else |
| 42 |
# include <SDL.h> |
| 43 |
# include <SDL_loadso.h> |
| 44 |
# endif |
| 45 |
# define Sys_LoadLibrary(f) SDL_LoadObject(f) |
| 46 |
# define Sys_UnloadLibrary(h) SDL_UnloadObject(h) |
| 47 |
# define Sys_LoadFunction(h,fn) SDL_LoadFunction(h,fn) |
| 48 |
# define Sys_LibraryError() SDL_GetError() |
| 49 |
#endif |
| 50 |
|
| 51 |
void * QDECL Sys_LoadDll(const char *name, qboolean useSystemLib); |