2022-09-18 15:37:21 +00:00
|
|
|
#pragma once
|
2022-09-18 18:43:59 +00:00
|
|
|
|
2022-09-18 15:37:21 +00:00
|
|
|
#ifdef DEDICATED
|
|
|
|
# ifdef _WIN32
|
|
|
|
# include <windows.h>
|
|
|
|
# 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 <dlfcn.h>
|
|
|
|
# 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
|
2022-09-18 18:43:59 +00:00
|
|
|
//# include <SDL.h>
|
|
|
|
//# include <SDL_loadso.h>
|
|
|
|
# define Sys_LoadLibrary(f) dlopen(f, RTLD_LAZY)
|
|
|
|
# define Sys_UnloadLibrary(h) dlclose(h)
|
|
|
|
# define Sys_LoadFunction(h,fn) dlsym(h,fn)
|
|
|
|
# define Sys_LibraryError() dlerror()
|
2022-09-18 15:37:21 +00:00
|
|
|
#endif
|
2022-09-18 18:43:59 +00:00
|
|
|
|
2022-09-18 15:37:21 +00:00
|
|
|
void * QDECL Sys_LoadDll(const char *name, qboolean useSystemLib);
|