aboutsummaryrefslogtreecommitdiff
path: root/src/mm-plugin.h
diff options
context:
space:
mode:
authorTing-Yuan Huang <laszio@chromium.org>2016-05-14 15:25:32 +0800
committerAleksander Morgado <aleksander@aleksander.es>2016-05-28 13:59:54 +0200
commit969189d42cc88bce9bdd6fb5e387352a02f81f2a (patch)
tree292eb4047d8b3c41d94283d56f29d1bda2bac0b4 /src/mm-plugin.h
parent55f3ab80835114342618083664c4fa585455b9e0 (diff)
plugin-manager: protect mm_plugin_{major,minor}_version
This patch makes declarations bind to definitions within the same module to prevent the potential ambiguity if referenced directly. AddressSanitizer think they violated one definition rule, although those symbols are accessed by address through their modules and do not depend on the order of the libararies loaded.
Diffstat (limited to 'src/mm-plugin.h')
-rw-r--r--src/mm-plugin.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mm-plugin.h b/src/mm-plugin.h
index ee03686b..04916794 100644
--- a/src/mm-plugin.h
+++ b/src/mm-plugin.h
@@ -31,6 +31,15 @@
#define MM_PLUGIN_MAJOR_VERSION 4
#define MM_PLUGIN_MINOR_VERSION 0
+#if defined (G_HAVE_GNUC_VISIBILITY)
+#define VISIBILITY __attribute__((visibility("protected")))
+#else
+#define VISIBILITY
+#endif
+
+#define MM_PLUGIN_DEFINE_MAJOR_VERSION VISIBILITY int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
+#define MM_PLUGIN_DEFINE_MINOR_VERSION VISIBILITY int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
+
#define MM_TYPE_PLUGIN (mm_plugin_get_type ())
#define MM_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN, MMPlugin))
#define MM_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN, MMPluginClass))