summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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