Replaced dynloader macros with real functions

pull/526/head
jsteube 8 years ago
parent 743dba56db
commit 1534f2c067

@ -15,18 +15,18 @@
#endif // __APPLE__
#endif // _POSIX
#if defined (_WIN)
#ifdef _WIN
#include <windows.h>
#endif // _WIN
#endif
#if defined (_WIN)
#define hc_dlopen LoadLibrary
#define hc_dlclose FreeLibrary
#define hc_dlsym GetProcAddress
#ifdef _WIN
HMODULE hc_dlopen (LPCSTR lpLibFileName);
BOOL hc_dlclose (HMODULE hLibModule);
FARPROC hc_dlsym (HMODULE hModule, LPCSTR lpProcName);
#else
#define hc_dlopen dlopen
#define hc_dlclose dlclose
#define hc_dlsym dlsym
void *hc_dlopen (const char *fileName, int flag);
int hc_dlclose (void *handle);
void *hc_dlsym (void *module, const char *symbol);
#endif
#define HC_LOAD_FUNC2(ptr,name,type,var,libname,noerr) \

@ -5,3 +5,39 @@
#include "common.h"
#include "dynloader.h"
#ifdef _WIN
HMODULE hc_dlopen (LPCSTR lpLibFileName)
{
return LoadLibraryA (lpLibFileName);
}
BOOL hc_dlclose (HMODULE hLibModule)
{
return FreeLibrary (hLibModule);
}
FARPROC hc_dlsym (HMODULE hModule, LPCSTR lpProcName)
{
return GetProcAddress (hModule, lpProcName);
}
#else
void *hc_dlopen (const char *fileName, int flag)
{
return dlopen (fileName, flag);
}
int hc_dlclose (void * handle)
{
return dlclose (handle);
}
void *hc_dlsym (void *module, const char *symbol)
{
return dlsym (module, symbol);
}
#endif

Loading…
Cancel
Save