summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-09-24 13:26:09 +0000
committerDavid Robillard <d@drobilla.net>2012-09-24 13:26:09 +0000
commit9cf8c3db0f1e4fdbb8a93fc1755b00a17a5af2d2 (patch)
tree1217d3c4b38c127aead168483977a831cdc3b557
parent317bd3621d6f64f5d25621a95600c300531a773d (diff)
downloadsuil-9cf8c3db0f1e4fdbb8a93fc1755b00a17a5af2d2.tar.gz
suil-9cf8c3db0f1e4fdbb8a93fc1755b00a17a5af2d2.tar.bz2
suil-9cf8c3db0f1e4fdbb8a93fc1755b00a17a5af2d2.zip
Fix suil_dlfunc on Windows (fix ticket #860).
git-svn-id: http://svn.drobilla.net/lad/trunk/suil@4792 a436a847-0d15-0410-975c-d299462d15a1
-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. */