aboutsummaryrefslogtreecommitdiff
path: root/base/plugins.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/plugins.h')
-rw-r--r--base/plugins.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/base/plugins.h b/base/plugins.h
index 84b1af5599..eb7e93ddba 100644
--- a/base/plugins.h
+++ b/base/plugins.h
@@ -90,6 +90,13 @@ extern int pluginTypeVersions[PLUGIN_TYPE_MAX];
#define PLUGIN_ENABLED_DYNAMIC(ID) \
(ENABLE_##ID && (ENABLE_##ID == DYNAMIC_PLUGIN) && DYNAMIC_MODULES)
+// see comments in backends/plugins/elf/elf-provider.cpp
+#if defined(ELF_LOADER_TARGET) && defined(ELF_LOADER_CXA_ATEXIT)
+#define PLUGIN_DYNAMIC_EXTRA_DECL uint32 __dso_handle __attribute__((visibility ("hidden"))) = 0
+#else
+#define PLUGIN_DYNAMIC_EXTRA_DECL
+#endif
+
/**
* REGISTER_PLUGIN_STATIC is a convenience macro which is used to declare
* the plugin interface for static plugins. Code (such as game engines)
@@ -119,6 +126,7 @@ extern int pluginTypeVersions[PLUGIN_TYPE_MAX];
*/
#define REGISTER_PLUGIN_DYNAMIC(ID,TYPE,PLUGINCLASS) \
extern "C" { \
+ PLUGIN_DYNAMIC_EXTRA_DECL; \
PLUGIN_EXPORT int32 PLUGIN_getVersion() { return PLUGIN_VERSION; } \
PLUGIN_EXPORT int32 PLUGIN_getType() { return TYPE; } \
PLUGIN_EXPORT int32 PLUGIN_getTypeVersion() { return TYPE##_VERSION; } \