diff options
Diffstat (limited to 'jim-win32compat.c')
-rw-r--r-- | jim-win32compat.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/jim-win32compat.c b/jim-win32compat.c index d99f5b2..76e7a96 100644 --- a/jim-win32compat.c +++ b/jim-win32compat.c @@ -88,3 +88,29 @@ struct dirent *readdir(DIR * dir) } return result; } + +void *dlopen(const char *path, int mode) +{ + JIM_NOTUSED(mode); + + return (void *)LoadLibraryA(path); +} + +int dlclose(void *handle) +{ + FreeLibrary((HANDLE)handle); + return 0; +} + +void *dlsym(void *handle, const char *symbol) +{ + return GetProcAddress((HMODULE)handle, symbol); +} + +const char *dlerror(void) +{ + static char msg[121]; + FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), + LANG_NEUTRAL, msg, sizeof(msg) - 1, NULL); + return msg; +} |