summaryrefslogtreecommitdiffstats
path: root/src/slv2_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/slv2_internal.h')
-rw-r--r--src/slv2_internal.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/slv2_internal.h b/src/slv2_internal.h
index 1c87a5e..2691c5d 100644
--- a/src/slv2_internal.h
+++ b/src/slv2_internal.h
@@ -30,6 +30,7 @@ extern "C" {
#include <stdint.h>
#include <stdlib.h>
#include <inttypes.h>
+#include <dlfcn.h>
#include <glib.h>
#include "serd/serd.h"
#include "sord/sord.h"
@@ -322,6 +323,17 @@ char* slv2_strjoin(const char* first, ...);
const char* slv2_get_lang();
uint8_t* slv2_qname_expand(SLV2Plugin p, const char* qname);
+typedef void (*VoidFunc)();
+
+/** dlsym wrapper to return a function pointer (without annoying warning) */
+static inline VoidFunc
+slv2_dlfunc(void* handle, const char* symbol)
+{
+ typedef VoidFunc (*VoidFuncGetter)(void*, const char*);
+ VoidFuncGetter dlfunc = (VoidFuncGetter)dlsym;
+ return dlfunc(handle, symbol);
+}
+
/* ********* Dynamic Manifest ********* */
#ifdef SLV2_DYN_MANIFEST
static const LV2_Feature* const dman_features = { NULL };