From Ned Harding: Basic implementation of dflcn header for win32

This commit is contained in:
Robert Carlsen
2009-04-08 06:59:49 +00:00
parent 53f4e6f224
commit 93b5007746

24
src/win32/dlfcn.h Normal file
View File

@@ -0,0 +1,24 @@
// VERY simplistic implementation of dlfcn.h for win32 since it isn't a standard header on windows
#ifndef DLFCN_H
#define DLFCN_H
#define RTLD_NOW 2
void *dlopen (const char *file, int /*mode*/)
{
return LoadLibraryA(file);
}
int dlclose (void *handle)
{
return FreeLibrary((HINSTANCE)handle)==0 ? 0 : -1;
}
void *dlsym (void *handle, const char *name)
{
return (void *)GetProcAddress((HINSTANCE)handle, name);
}
#endif // DLFCN_H