summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/suil_internal.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/suil_internal.h b/src/suil_internal.h
index 4d4bfde..67f1412 100644
--- a/src/suil_internal.h
+++ b/src/suil_internal.h
@@ -25,7 +25,6 @@
#include <windows.h>
#define dlopen(path, flags) LoadLibrary(path)
#define dlclose(lib) FreeLibrary((HMODULE)lib)
-#define dlsym GetProcAddress
#define inline __inline
#define snprintf _snprintf
static inline char* dlerror(void) { return "Unknown error"; }
@@ -108,9 +107,13 @@ typedef void (*SuilVoidFunc)(void);
static inline SuilVoidFunc
suil_dlfunc(void* handle, const char* symbol)
{
+#ifdef _WIN32
+ return (SuilVoidFunc)GetProcAddress((HMODULE)handle, symbol);
+#else
typedef SuilVoidFunc (*VoidFuncGetter)(void*, const char*);
VoidFuncGetter dlfunc = (VoidFuncGetter)dlsym;
return dlfunc(handle, symbol);
+#endif
}
/** Add a feature to a (mutable) LV2 feature array. */