From 680abdb047c1a66d3ccc14cad518117773c3cc8c Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 17 Jun 2017 14:14:21 +0200 Subject: [PATCH] fix windows build We should change the XBT_PUBLIC(type) macro into a XBT_PUBLIC just as XBT_PRIVATE. But that's a big change and I have other ongoing things. --- include/simgrid/s4u/Storage.hpp | 2 +- include/xbt/base.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/simgrid/s4u/Storage.hpp b/include/simgrid/s4u/Storage.hpp index 12bfe853a3..3c11ee8b0e 100644 --- a/include/simgrid/s4u/Storage.hpp +++ b/include/simgrid/s4u/Storage.hpp @@ -17,7 +17,7 @@ namespace simgrid { namespace s4u { -std::map* allStorages(); +XBT_ATTRIB_PUBLIC std::map* allStorages(); XBT_PUBLIC_CLASS Storage { diff --git a/include/xbt/base.h b/include/xbt/base.h index 68ea79ea08..ba5e76fd2b 100644 --- a/include/xbt/base.h +++ b/include/xbt/base.h @@ -137,6 +137,7 @@ /* Build the DLL */ #if defined(DLL_EXPORT) +# define XBT_ATTRIB_PUBLIC __declspec(dllexport) # define XBT_PUBLIC(type) __declspec(dllexport) type # define XBT_EXPORT_NO_IMPORT(type) __declspec(dllexport) type # define XBT_IMPORT_NO_EXPORT(type) type @@ -146,6 +147,7 @@ /* Link against the DLL */ #elif (defined(_WIN32) && !defined(DLL_EXPORT)) +# define XBT_ATTRIB_PUBLIC __declspec(dllimport) # define XBT_PUBLIC(type) __declspec(dllimport) type # define XBT_EXPORT_NO_IMPORT(type) type # define XBT_IMPORT_NO_EXPORT(type) __declspec(dllimport) type @@ -154,6 +156,7 @@ # define XBT_PRIVATE #elif defined(__ELF__) +# define XBT_ATTRIB_PUBLIC __attribute__((visibility("default"))) # 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 @@ -162,6 +165,7 @@ # define XBT_PRIVATE __attribute__((visibility("hidden"))) #else +# define XBT_ATTRIB_PUBLIC /* public */ # define XBT_PUBLIC(type) type # define XBT_EXPORT_NO_IMPORT(type) type # define XBT_IMPORT_NO_EXPORT(type) type -- 2.20.1