From d872432e344577c86d324ab6c90e15088c5839ac Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Fri, 9 Jan 2015 21:37:55 -0800 Subject: [PATCH 1/4] CMake Policies must exist before they can be set --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b8f23719..511bca95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,9 @@ project(Plasma) cmake_minimum_required(VERSION 2.8.11.2) -cmake_policy(SET CMP0054 NEW) + +if(POLICY CMP0054) + cmake_policy(SET CMP0054 NEW) +endif() # Set up Product Identification parameters set(PRODUCT_BRANCH_ID "1" CACHE STRING "Branch ID") From 8bbb5609664a51e44a8484a97aa5954c7ff56225 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Fri, 9 Jan 2015 21:39:02 -0800 Subject: [PATCH 2/4] Require C++14 for std::make_unique --- Sources/Plasma/CoreLib/HeadSpin.h | 6 +++--- cmake/CompilerChecks.cmake | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Plasma/CoreLib/HeadSpin.h b/Sources/Plasma/CoreLib/HeadSpin.h index 69c6d7f7..41985112 100644 --- a/Sources/Plasma/CoreLib/HeadSpin.h +++ b/Sources/Plasma/CoreLib/HeadSpin.h @@ -120,10 +120,10 @@ typedef int32_t hsError; #define hsFailed(r) ((hsError)(r)=hsOK) -#if defined(HAVE_CXX14_DEPRECATED_ATTR) -# define hsDeprecated(message) [[deprecated(message)]] -#elif defined(HAVE_GCC_DEPRECATED_ATTR) +#if defined(HAVE_GCC_DEPRECATED_ATTR) # define hsDeprecated(message) __attribute__((deprecated(message))) +#elif defined(HAVE_CXX14_DEPRECATED_ATTR) +# define hsDeprecated(message) [[deprecated(message)]] #elif defined(_MSC_VER) # define hsDeprecated(message) __declspec(deprecated(message)) #else diff --git a/cmake/CompilerChecks.cmake b/cmake/CompilerChecks.cmake index 8b7e21fb..aa85866c 100644 --- a/cmake/CompilerChecks.cmake +++ b/cmake/CompilerChecks.cmake @@ -5,7 +5,7 @@ endif() # Require C++11 if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y") if(APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") endif() From dde0d399f616d9ca7ef34094de8649f97bbb7dd2 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Fri, 9 Jan 2015 21:42:55 -0800 Subject: [PATCH 3/4] Implicit conversion to plString is apparently an MSVC thing --- .../PubUtilLib/plVault/plVaultClientApi.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp index 86ae798c..e3092106 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp @@ -1383,6 +1383,10 @@ void RelVaultNode::Print (const plString& tag, unsigned level) { case k##flag: \ ss << ", " #flag "=\"" << Get##flag() << "\""; \ break; +#define STPRINT_UUID(flag) \ + case k##flag: \ + ss << ", " #flag "=\"" << Get##flag().AsString() << "\""; \ + break; #define STPRINT_ESCAPE(flag) \ case k##flag: \ ss << ", " #flag "=\"" << Get##flag().Replace("\"", "\\\"") << "\""; \ @@ -1397,8 +1401,8 @@ void RelVaultNode::Print (const plString& tag, unsigned level) { STPRINT(CreateTime); STPRINT(ModifyTime); STPRINT(CreateAgeName); - STPRINT(CreateAgeUuid); - STPRINT(CreatorAcct); + STPRINT_UUID(CreateAgeUuid); + STPRINT_UUID(CreatorAcct); STPRINT(CreatorId); STPRINT(NodeType); STPRINT(Int32_1); @@ -1409,10 +1413,10 @@ void RelVaultNode::Print (const plString& tag, unsigned level) { STPRINT(UInt32_2); STPRINT(UInt32_3); STPRINT(UInt32_4); - STPRINT(Uuid_1); - STPRINT(Uuid_2); - STPRINT(Uuid_3); - STPRINT(Uuid_4); + STPRINT_UUID(Uuid_1); + STPRINT_UUID(Uuid_2); + STPRINT_UUID(Uuid_3); + STPRINT_UUID(Uuid_4); STPRINT_ESCAPE(String64_1); STPRINT_ESCAPE(String64_2); STPRINT_ESCAPE(String64_3); From a110dc0f7c14c40a71f2e38955163e11acd86bc0 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Fri, 9 Jan 2015 21:50:43 -0800 Subject: [PATCH 4/4] Fix narrowing-conversion werrors from Clang --- .../pnNetProtocol/Private/pnNpCommon.h | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h index 1ffdeaa4..a16328a6 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h @@ -156,40 +156,40 @@ struct NetGameRank { class NetVaultNode : public hsRefCnt { protected: - enum NodeFields + enum NodeFields : uint32_t { - kNodeId = (1 << 0), - kCreateTime = (1 << 1), - kModifyTime = (1 << 2), - kCreateAgeName = (1 << 3), - kCreateAgeUuid = (1 << 4), - kCreatorAcct = (1 << 5), - kCreatorId = (1 << 6), - kNodeType = (1 << 7), - kInt32_1 = (1 << 8), - kInt32_2 = (1 << 9), - kInt32_3 = (1 << 10), - kInt32_4 = (1 << 11), - kUInt32_1 = (1 << 12), - kUInt32_2 = (1 << 13), - kUInt32_3 = (1 << 14), - kUInt32_4 = (1 << 15), - kUuid_1 = (1 << 16), - kUuid_2 = (1 << 17), - kUuid_3 = (1 << 18), - kUuid_4 = (1 << 19), - kString64_1 = (1 << 20), - kString64_2 = (1 << 21), - kString64_3 = (1 << 22), - kString64_4 = (1 << 23), - kString64_5 = (1 << 24), - kString64_6 = (1 << 25), - kIString64_1 = (1 << 26), - kIString64_2 = (1 << 27), - kText_1 = (1 << 28), - kText_2 = (1 << 29), - kBlob_1 = (1 << 30), - kBlob_2 = (1 << 31), + kNodeId = (1u << 0), + kCreateTime = (1u << 1), + kModifyTime = (1u << 2), + kCreateAgeName = (1u << 3), + kCreateAgeUuid = (1u << 4), + kCreatorAcct = (1u << 5), + kCreatorId = (1u << 6), + kNodeType = (1u << 7), + kInt32_1 = (1u << 8), + kInt32_2 = (1u << 9), + kInt32_3 = (1u << 10), + kInt32_4 = (1u << 11), + kUInt32_1 = (1u << 12), + kUInt32_2 = (1u << 13), + kUInt32_3 = (1u << 14), + kUInt32_4 = (1u << 15), + kUuid_1 = (1u << 16), + kUuid_2 = (1u << 17), + kUuid_3 = (1u << 18), + kUuid_4 = (1u << 19), + kString64_1 = (1u << 20), + kString64_2 = (1u << 21), + kString64_3 = (1u << 22), + kString64_4 = (1u << 23), + kString64_5 = (1u << 24), + kString64_6 = (1u << 25), + kIString64_1 = (1u << 26), + kIString64_2 = (1u << 27), + kText_1 = (1u << 28), + kText_2 = (1u << 29), + kBlob_1 = (1u << 30), + kBlob_2 = (1u << 31), kValidFields = (kNodeId | kCreateTime | kModifyTime | kCreateAgeName | kCreateAgeUuid | kCreatorAcct | kCreatorId | kNodeType | kInt32_1 | kInt32_2 | kInt32_3 |