summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-10-30 14:43:54 +0000
committerDavid Robillard <d@drobilla.net>2013-10-30 14:43:54 +0000
commit40ec4d79702be71525994d23e4a2d950ce945b75 (patch)
treee16bc30cc8c0d61733f6dbac886f1f58ac3aa1df
parent9b855e16294bedda04a82308f48bbefb6fc5f70d (diff)
downloadlilv-40ec4d79702be71525994d23e4a2d950ce945b75.tar.gz
lilv-40ec4d79702be71525994d23e4a2d950ce945b75.tar.bz2
lilv-40ec4d79702be71525994d23e4a2d950ce945b75.zip
Call GetProcAddress with correct calling convention on Windows (fix #932).
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5164 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--NEWS5
-rw-r--r--src/lilv_internal.h11
2 files changed, 10 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index 32b8d95..4fc209d 100644
--- a/NEWS
+++ b/NEWS
@@ -4,10 +4,11 @@ lilv (0.16.1) unstable;
for restoring port values via a callback only
* Fix unlikely memory leak in lilv_plugin_instantiate()
* Support denoting latency ports with lv2:designation lv2:latency
- * Allow passing NULL port_class to lilv_plugin_get_port_by_designation.
+ * Allow passing NULL port_class to lilv_plugin_get_port_by_designation
+ * Call GetProcAddress with correct calling convention on Windows
* lilvmm.hpp: Add wrappers for UI API
- -- David Robillard <d@drobilla.net> Sun, 25 Aug 2013 11:38:16 -0400
+ -- David Robillard <d@drobilla.net> Wed, 30 Oct 2013 10:42:51 -0400
lilv (0.16.0) stable;
diff --git a/src/lilv_internal.h b/src/lilv_internal.h
index 95bcee7..502d214 100644
--- a/src/lilv_internal.h
+++ b/src/lilv_internal.h
@@ -30,7 +30,6 @@ extern "C" {
# include <windows.h>
# define dlopen(path, flags) LoadLibrary(path)
# define dlclose(lib) FreeLibrary((HMODULE)lib)
-# define dlsym GetProcAddress
# ifdef _MSC_VER
# define __func__ __FUNCTION__
# define INFINITY DBL_MAX + DBL_MAX
@@ -358,15 +357,19 @@ lilv_dir_for_each(const char* path,
void* data,
void (*f)(const char* path, const char* name, void* data));
-typedef void (*VoidFunc)(void);
+typedef void (*LilvVoidFunc)(void);
/** dlsym wrapper to return a function pointer (without annoying warning) */
-static inline VoidFunc
+static inline LilvVoidFunc
lilv_dlfunc(void* handle, const char* symbol)
{
- typedef VoidFunc (*VoidFuncGetter)(void*, const char*);
+#ifdef _WIN32
+ return (LilvVoidFunc)GetProcAddress((HMODULE)handle, symbol);
+#else
+ typedef LilvVoidFunc (*VoidFuncGetter)(void*, const char*);
VoidFuncGetter dlfunc = (VoidFuncGetter)dlsym;
return dlfunc(handle, symbol);
+#endif
}
#ifdef LILV_DYN_MANIFEST