changeset 35:2af772742d0b

fix export of symbols in holy-build-box
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 02 Jul 2020 11:15:14 +0200
parents eb09eb1251b9
children 92b93845d84b
files Plugin/Plugin.cpp
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Plugin/Plugin.cpp	Wed Jul 01 16:46:13 2020 +0200
+++ b/Plugin/Plugin.cpp	Thu Jul 02 11:15:14 2020 +0200
@@ -126,6 +126,24 @@
 
 
 
+/**
+ * We force the redefinition of the "ORTHANC_PLUGINS_API" macro, that
+ * was left empty with gcc until Orthanc SDK 1.5.7 (no "default"
+ * visibility). This causes the version script, if run from "Holy
+ * Build Box", to make private the 4 global functions of the plugin.
+ **/
+
+#undef ORTHANC_PLUGINS_API
+
+#ifdef WIN32
+#  define ORTHANC_PLUGINS_API __declspec(dllexport)
+#elif __GNUC__ >= 4
+#  define ORTHANC_PLUGINS_API __attribute__((visibility ("default")))
+#else
+#  define ORTHANC_PLUGINS_API
+#endif
+
+
 extern "C"
 {
   ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context)