From e525cb560f69f591d44a6644f5c76c8a01fea2da Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 6 Apr 2015 12:48:22 +0300 Subject: [PATCH] Revert "simplified visibility" This reverts commit 4c0590737e5988f1c97d07ff8c4aa0d33cb19316. --- include/boost/archive/detail/decl.hpp | 48 +++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/include/boost/archive/detail/decl.hpp b/include/boost/archive/detail/decl.hpp index d0181400..cf0071cb 100644 --- a/include/boost/archive/detail/decl.hpp +++ b/include/boost/archive/detail/decl.hpp @@ -27,19 +27,53 @@ #if defined(BOOST_HAS_DECLSPEC) #if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)) #if defined(BOOST_ARCHIVE_SOURCE) - #define BOOST_ARCHIVE_DECL(T) BOOST_SYMBOL_EXPORT T - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) BOOST_SYMBOL_EXPORT T + #if defined(__BORLANDC__) + #define BOOST_ARCHIVE_DECL(T) T __export + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __export + #elif defined(BOOST_GCC) && BOOST_GCC >= 4 + #define BOOST_ARCHIVE_DECL(T) __attribute__ ((visibility ("default"))) + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __attribute__ ((visibility ("default"))) + #else + #define BOOST_ARCHIVE_DECL(T) __declspec(dllexport) T + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllexport) T + #endif #else - #define BOOST_ARCHIVE_DECL(T) BOOST_SYMBOL_IMPORT T + #if defined(__BORLANDC__) + #define BOOST_ARCHIVE_DECL(T) T __import + #elif defined(BOOST_GCC) && BOOST_GCC >= 4 + #define BOOST_ARCHIVE_DECL(T) __attribute__ ((visibility ("default"))) + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __attribute__ ((visibility ("default"))) + #else + #define BOOST_ARCHIVE_DECL(T) __declspec(dllimport) T + #endif #endif #if defined(BOOST_WARCHIVE_SOURCE) - #define BOOST_WARCHIVE_DECL(T) BOOST_SYMBOL_EXPORT T - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) BOOST_SYMBOL_EXPORT T + #if defined(__BORLANDC__) + #define BOOST_WARCHIVE_DECL(T) T __export + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __export + #elif defined(BOOST_GCC) && BOOST_GCC >= 4 + #define BOOST_WARCHIVE_DECL(T) __attribute__ ((visibility ("default"))) + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __attribute__ ((visibility ("default"))) + #else + #define BOOST_WARCHIVE_DECL(T) __declspec(dllexport) T + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllexport) T + #endif #else - #define BOOST_WARCHIVE_DECL(T) BOOST_SYMBOL_IMPORT T + #if defined(__BORLANDC__) + #define BOOST_WARCHIVE_DECL(T) T __import + #elif defined(BOOST_GCC) && BOOST_GCC >= 4 + #define BOOST_WARCHIVE_DECL(T) __attribute__ ((visibility ("default"))) + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __attribute__ ((visibility ("default"))) + #else + #define BOOST_WARCHIVE_DECL(T) __declspec(dllimport) T + #endif #endif #if !defined(BOOST_WARCHIVE_SOURCE) && !defined(BOOST_ARCHIVE_SOURCE) - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) BOOST_SYMBOL_IMPORT T + #if defined(__BORLANDC__) + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __import + #else + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllimport) T + #endif #endif #endif #endif // BOOST_HAS_DECLSPEC