mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-08 18:33:30 +00:00
add dynamic
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@687 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
26
src/abstract/dynamic.c
Normal file
26
src/abstract/dynamic.c
Normal file
@@ -0,0 +1,26 @@
|
||||
/* $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
|
||||
}
|
||||
Reference in New Issue
Block a user