From 00b6232ff6972ed422d3a867dd18602a65f656e4 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 26 Jun 2014 18:34:54 +0300 Subject: [PATCH] Replaced usage of DLL_LINKAGE with ELF_VISIBILITY in netpacks. Please make sure that compilation now works on all platforms --- Global.h | 6 +++++- lib/NetPacks.h | 11 +++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Global.h b/Global.h index a9c81fe59..def02d647 100644 --- a/Global.h +++ b/Global.h @@ -152,9 +152,11 @@ typedef boost::lock_guard TLockGuardRec; # else # define DLL_EXPORT __declspec(dllexport) # endif +# define ELF_VISIBILITY #else # ifdef __GNUC__ -# define DLL_EXPORT __attribute__ ((visibility("default"))) +# define DLL_EXPORT __attribute__ ((visibility("default"))) +# define ELF_VISIBILITY __attribute__ ((visibility("default"))) # endif #endif @@ -164,9 +166,11 @@ typedef boost::lock_guard TLockGuardRec; # else # define DLL_IMPORT __declspec(dllimport) # endif +# define ELF_VISIBILITY #else # ifdef __GNUC__ # define DLL_IMPORT __attribute__ ((visibility("default"))) +# define ELF_VISIBILITY __attribute__ ((visibility("default"))) # endif #endif diff --git a/lib/NetPacks.h b/lib/NetPacks.h index 2d7f30e15..14234899d 100644 --- a/lib/NetPacks.h +++ b/lib/NetPacks.h @@ -1515,12 +1515,7 @@ struct ObstaclesRemoved : public CPackForClient //3014 } }; -//FIXME: figure out why gcc fails to find type_info for this class with -fvisibility=hidden flag set -#if defined(__linux__) || defined(__APPLE__) -struct DLL_LINKAGE CatapultAttack : public CPackForClient //3015 -#else -struct CatapultAttack : public CPackForClient //3015 -#endif +struct ELF_VISIBILITY CatapultAttack : public CPackForClient //3015 { struct AttackInfo @@ -2130,7 +2125,7 @@ struct PlayerJoined : public CPregamePackToHost } }; -struct DLL_LINKAGE SelectMap : public CPregamePackToPropagate +struct ELF_VISIBILITY SelectMap : public CPregamePackToPropagate { const CMapInfo *mapInfo; bool free; @@ -2156,7 +2151,7 @@ struct DLL_LINKAGE SelectMap : public CPregamePackToPropagate }; -struct DLL_LINKAGE UpdateStartOptions : public CPregamePackToPropagate +struct ELF_VISIBILITY UpdateStartOptions : public CPregamePackToPropagate { StartInfo *options; bool free;