Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[xbt] Fix XBT_PUBLIC definition for ELF/*nix
authorGabriel Corona <gabriel.corona@loria.fr>
Thu, 10 Dec 2015 15:38:58 +0000 (16:38 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Thu, 10 Dec 2015 15:39:17 +0000 (16:39 +0100)
include/xbt/base.h

index dcbaca2..22f1a55 100644 (file)
 #  define XBT_PUBLIC_DATA(type)       extern __declspec(dllimport) type
 #  define XBT_PUBLIC_CLASS            class __declspec(dllimport)
 
-
-/* UNIX build */
 #elif defined(__ELF__) 
+#  define XBT_PUBLIC(type)            __attribute__((visibility("default"))) type
+#  define XBT_EXPORT_NO_IMPORT(type)  __attribute__((visibility("default"))) type
+#  define XBT_IMPORT_NO_EXPORT(type)  __attribute__((visibility("default"))) type
+#  define XBT_PUBLIC_DATA(type)       extern __attribute__((visibility("default"))) type
+#  define XBT_PUBLIC_CLASS            class __attribute__((visibility("default")))
 
+#else
 #  define XBT_PUBLIC(type)            type
 #  define XBT_EXPORT_NO_IMPORT(type)  type
 #  define XBT_IMPORT_NO_EXPORT(type)  type
 #  define XBT_PUBLIC_DATA(type)       extern type
 #  define XBT_PUBLIC_CLASS            class
 
-#else
-#  define XBT_PUBLIC(type)            __attribute__((visibility("default"))) type
-#  define XBT_EXPORT_NO_IMPORT(type)  __attribute__((visibility("default"))) type
-#  define XBT_IMPORT_NO_EXPORT(type)  __attribute__((visibility("default"))) type
-#  define XBT_PUBLIC_DATA(type)       extern __attribute__((visibility("default"))) type
-#  define XBT_PUBLIC_CLASS            class __attribute__((visibility("default")))
-
 #endif
 
 #ifdef __ELF__