Files
milsko/src/abstract/dynamic.c
NishiOwO 4df3f4658b add dynamic
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@687 b9cfdab3-6d41-4d17-bbe4-086880011989
2025-11-13 03:34:33 +00:00

27 lines
442 B
C

/* $Id$ */
#include <Mw/Milsko.h>
void* MwDynamicOpen(const char* path) {
#ifdef _WIN32
return LoadLibrary(path);
#else
return dlopen(path, RTLD_LAZY | RTLD_LOCAL);
#endif
}
void* MwDynamicSymbol(void* handle, const char* symbol) {
#ifdef _WIN32
return GetProcAddress(handle, symbol);
#else
return dlsym(handle, symbol);
#endif
}
void MwDynamicClose(void* handle) {
#ifdef _WIN32
FreeLibrary(handle);
#else
dlclose(handle);
#endif
}