From d5080e07cbab9022c06bd87df464118bea96edd6 Mon Sep 17 00:00:00 2001 From: Guillaume Dupuy Date: Fri, 28 Apr 2017 23:56:06 +0200 Subject: [PATCH 1/2] Fix compilation on mac (thanks Siela for the fixes !) --HG-- branch : fix_compilation_mac --- .../entities_game_service/harvest_source.cpp | 2 +- .../gateway_fes_transport.cpp | 8 +-- .../mail_forum_service/mail_forum_service.cpp | 2 +- .../src/monitor_service/service_main.cpp | 4 ++ code/ryzom/server/src/pd_lib/pd_messages.h | 2 +- .../server/src/server_share/mysql_wrapper.h | 3 + .../database_mapping.cpp | 72 +++++++++---------- 7 files changed, 50 insertions(+), 43 deletions(-) diff --git a/code/ryzom/server/src/entities_game_service/harvest_source.cpp b/code/ryzom/server/src/entities_game_service/harvest_source.cpp index e78d3bea0..5a150acc3 100644 --- a/code/ryzom/server/src/entities_game_service/harvest_source.cpp +++ b/code/ryzom/server/src/entities_game_service/harvest_source.cpp @@ -84,7 +84,7 @@ uint ImpactSchemes [6][3] = { { 0, 1, 2 }, { 0, 2, 1 }, { 1, 0, 2 }, { 1, 2, 0 } // Observed impact on E (/10): 6 3 1 1 3 10 // Note: if modifying this schemes, please change FORAGE_SOURCE_IMPACT_MODE in phrase_en.txt. uint SpecialNewbieImpactSchemeD = 10; -uint16 LowDangerMappings [2] = { (uint16)SpecialNewbieImpactSchemeD+1, (uint16)SpecialNewbieImpactSchemeD+4 }; +uint16 LowDangerMappings [2] = {(uint16)(SpecialNewbieImpactSchemeD+1), (uint16)(SpecialNewbieImpactSchemeD+4)}; sint8 ExplosionResetPeriod = 50; // 5 s diff --git a/code/ryzom/server/src/frontend_service/gateway_fes_transport.cpp b/code/ryzom/server/src/frontend_service/gateway_fes_transport.cpp index e67797dff..a24fd8d51 100644 --- a/code/ryzom/server/src/frontend_service/gateway_fes_transport.cpp +++ b/code/ryzom/server/src/frontend_service/gateway_fes_transport.cpp @@ -48,19 +48,19 @@ public: SerialNumber(0) { // warn the client that the transport is open - CMessage nil; - sendRawMessage("MODULE_GATEWAY:FEOPEN", nil); + CMessage msg; + sendRawMessage("MODULE_GATEWAY:FEOPEN", msg); } ~CFEServerRoute() { // warn the client that the transport is closed - CMessage nil; + CMessage msg; // check special case when application close if (!CActionFactory::isInstanceAllocated()) return; - sendRawMessage("MODULE_GATEWAY:FECLOSE", nil); + sendRawMessage("MODULE_GATEWAY:FECLOSE", msg); } diff --git a/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp b/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp index 79e2008de..712ecc941 100644 --- a/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp +++ b/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp @@ -179,7 +179,7 @@ void CMailForumService::checkFile(const std::string& file) ++pt; // file contents "$$$$" -> end of file marker, file is complete, can be deleted - if (pt != '\0') + if (*pt != '\0') { CFile::deleteFile(file); diff --git a/code/ryzom/server/src/monitor_service/service_main.cpp b/code/ryzom/server/src/monitor_service/service_main.cpp index 56ae2c1ac..96786d910 100644 --- a/code/ryzom/server/src/monitor_service/service_main.cpp +++ b/code/ryzom/server/src/monitor_service/service_main.cpp @@ -36,6 +36,10 @@ typedef unsigned long ulong; #endif // NL_OS_WINDOWS +#ifdef NL_OS_MAC +typedef unsigned long ulong; +#endif + #include using namespace NLMISC; diff --git a/code/ryzom/server/src/pd_lib/pd_messages.h b/code/ryzom/server/src/pd_lib/pd_messages.h index 41e2c2db2..71ba33b58 100644 --- a/code/ryzom/server/src/pd_lib/pd_messages.h +++ b/code/ryzom/server/src/pd_lib/pd_messages.h @@ -55,7 +55,7 @@ namespace RY_PDS * 0 is remapped to the new object value that appears in stream and so on (reallocations are done * circularly through key values). Mask value is for test purposes only, not to be changed! */ -template > +template > class CObjCircMapper { public: diff --git a/code/ryzom/server/src/server_share/mysql_wrapper.h b/code/ryzom/server/src/server_share/mysql_wrapper.h index 14e7b58b1..730b09301 100644 --- a/code/ryzom/server/src/server_share/mysql_wrapper.h +++ b/code/ryzom/server/src/server_share/mysql_wrapper.h @@ -30,6 +30,9 @@ # include typedef unsigned long ulong; #endif +#ifdef NL_OS_MAC +typedef unsigned long ulong; +#endif #include #include diff --git a/code/ryzom/server/src/shard_unifier_service/database_mapping.cpp b/code/ryzom/server/src/shard_unifier_service/database_mapping.cpp index 5433f44eb..0e5ba5489 100644 --- a/code/ryzom/server/src/shard_unifier_service/database_mapping.cpp +++ b/code/ryzom/server/src/shard_unifier_service/database_mapping.cpp @@ -2201,9 +2201,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CSessionPtr nil; + static CSessionPtr nilPtr; - return nil; + return nilPtr; } @@ -2252,9 +2252,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CSessionParticipantPtr nil; + static CSessionParticipantPtr nilPtr; - return nil; + return nilPtr; } @@ -2303,9 +2303,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CKnownUserPtr nil; + static CKnownUserPtr nilPtr; - return nil; + return nilPtr; } @@ -2354,9 +2354,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CPlayerRatingPtr nil; + static CPlayerRatingPtr nilPtr; - return nil; + return nilPtr; } @@ -3016,9 +3016,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CKnownUserPtr nil; + static CKnownUserPtr nilPtr; - return nil; + return nilPtr; } @@ -3054,8 +3054,8 @@ namespace RSMGR if (it == _Characters->end()) { // no object with this id, return a null pointer - static CCharacterPtr nil; - return nil; + static CCharacterPtr nilPtr; + return nilPtr; } return const_cast< CCharacterPtr & >(it->second); @@ -3107,9 +3107,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CFolderPtr nil; + static CFolderPtr nilPtr; - return nil; + return nilPtr; } @@ -3158,9 +3158,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CFolderAccessPtr nil; + static CFolderAccessPtr nilPtr; - return nil; + return nilPtr; } @@ -4273,9 +4273,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CSessionParticipantPtr nil; + static CSessionParticipantPtr nilPtr; - return nil; + return nilPtr; } @@ -4324,9 +4324,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CGuildInvitePtr nil; + static CGuildInvitePtr nilPtr; - return nil; + return nilPtr; } @@ -4375,9 +4375,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CJournalEntryPtr nil; + static CJournalEntryPtr nilPtr; - return nil; + return nilPtr; } @@ -4891,8 +4891,8 @@ namespace RSMGR if (it == _Guilds->end()) { // no object with this id, return a null pointer - static CGuildPtr nil; - return nil; + static CGuildPtr nilPtr; + return nilPtr; } return const_cast< CGuildPtr & >(it->second); @@ -5514,9 +5514,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CCharacterPtr nil; + static CCharacterPtr nilPtr; - return nil; + return nilPtr; } @@ -5565,9 +5565,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CGuildInvitePtr nil; + static CGuildInvitePtr nilPtr; - return nil; + return nilPtr; } @@ -8046,9 +8046,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CFolderAccessPtr nil; + static CFolderAccessPtr nilPtr; - return nil; + return nilPtr; } @@ -8097,9 +8097,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CSessionPtr nil; + static CSessionPtr nilPtr; - return nil; + return nilPtr; } @@ -9312,9 +9312,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CSessionLogPtr nil; + static CSessionLogPtr nilPtr; - return nil; + return nilPtr; } @@ -9363,9 +9363,9 @@ namespace RSMGR } // no object with this id, return a null pointer - static CPlayerRatingPtr nil; + static CPlayerRatingPtr nilPtr; - return nil; + return nilPtr; } From 431e2349d5896c672f73b8489edc6fcecd591044 Mon Sep 17 00:00:00 2001 From: Guillaume Dupuy Date: Fri, 28 Apr 2017 23:58:16 +0200 Subject: [PATCH 2/2] Fix build with macOS clang --HG-- branch : fix_compilation_mac --- code/ryzom/server/src/ai_service/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/ryzom/server/src/ai_service/CMakeLists.txt b/code/ryzom/server/src/ai_service/CMakeLists.txt index c22fe6496..fb439820d 100644 --- a/code/ryzom/server/src/ai_service/CMakeLists.txt +++ b/code/ryzom/server/src/ai_service/CMakeLists.txt @@ -1,3 +1,6 @@ +IF(APPLE) + add_definitions("-ftemplate-depth=100") +ENDIF() FILE(GLOB SRC *.cpp *.h) LIST(REMOVE_ITEM SRC