瀏覽代碼

Replaced usage of DLL_LINKAGE with ELF_VISIBILITY in netpacks. Please make sure that compilation now works on all platforms

Ivan Savenko 11 年之前
父節點
當前提交
00b6232ff6
共有 2 個文件被更改,包括 8 次插入9 次删除
  1. 5 1
      Global.h
  2. 3 8
      lib/NetPacks.h

+ 5 - 1
Global.h

@@ -152,9 +152,11 @@ typedef boost::lock_guard<boost::recursive_mutex> 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<boost::recursive_mutex> 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
 

+ 3 - 8
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;