Browse Source

Merge pull request #471 from zrax/gcc_fixes

GCC fixes
Adam Johnson 10 years ago
parent
commit
645135b015
  1. 5
      CMakeLists.txt
  2. 6
      Sources/Plasma/CoreLib/HeadSpin.h
  3. 66
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h
  4. 16
      Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp
  5. 2
      cmake/CompilerChecks.cmake

5
CMakeLists.txt

@ -1,6 +1,9 @@
project(Plasma) project(Plasma)
cmake_minimum_required(VERSION 2.8.11.2) 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 up Product Identification parameters
set(PRODUCT_BRANCH_ID "1" CACHE STRING "Branch ID") set(PRODUCT_BRANCH_ID "1" CACHE STRING "Branch ID")

6
Sources/Plasma/CoreLib/HeadSpin.h

@ -120,10 +120,10 @@ typedef int32_t hsError;
#define hsFailed(r) ((hsError)(r)<hsOK) #define hsFailed(r) ((hsError)(r)<hsOK)
#define hsSucceeded(r) ((hsError)(r)>=hsOK) #define hsSucceeded(r) ((hsError)(r)>=hsOK)
#if defined(HAVE_CXX14_DEPRECATED_ATTR) #if defined(HAVE_GCC_DEPRECATED_ATTR)
# define hsDeprecated(message) [[deprecated(message)]]
#elif defined(HAVE_GCC_DEPRECATED_ATTR)
# define hsDeprecated(message) __attribute__((deprecated(message))) # define hsDeprecated(message) __attribute__((deprecated(message)))
#elif defined(HAVE_CXX14_DEPRECATED_ATTR)
# define hsDeprecated(message) [[deprecated(message)]]
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
# define hsDeprecated(message) __declspec(deprecated(message)) # define hsDeprecated(message) __declspec(deprecated(message))
#else #else

66
Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h

@ -156,40 +156,40 @@ struct NetGameRank {
class NetVaultNode : public hsRefCnt class NetVaultNode : public hsRefCnt
{ {
protected: protected:
enum NodeFields enum NodeFields : uint32_t
{ {
kNodeId = (1 << 0), kNodeId = (1u << 0),
kCreateTime = (1 << 1), kCreateTime = (1u << 1),
kModifyTime = (1 << 2), kModifyTime = (1u << 2),
kCreateAgeName = (1 << 3), kCreateAgeName = (1u << 3),
kCreateAgeUuid = (1 << 4), kCreateAgeUuid = (1u << 4),
kCreatorAcct = (1 << 5), kCreatorAcct = (1u << 5),
kCreatorId = (1 << 6), kCreatorId = (1u << 6),
kNodeType = (1 << 7), kNodeType = (1u << 7),
kInt32_1 = (1 << 8), kInt32_1 = (1u << 8),
kInt32_2 = (1 << 9), kInt32_2 = (1u << 9),
kInt32_3 = (1 << 10), kInt32_3 = (1u << 10),
kInt32_4 = (1 << 11), kInt32_4 = (1u << 11),
kUInt32_1 = (1 << 12), kUInt32_1 = (1u << 12),
kUInt32_2 = (1 << 13), kUInt32_2 = (1u << 13),
kUInt32_3 = (1 << 14), kUInt32_3 = (1u << 14),
kUInt32_4 = (1 << 15), kUInt32_4 = (1u << 15),
kUuid_1 = (1 << 16), kUuid_1 = (1u << 16),
kUuid_2 = (1 << 17), kUuid_2 = (1u << 17),
kUuid_3 = (1 << 18), kUuid_3 = (1u << 18),
kUuid_4 = (1 << 19), kUuid_4 = (1u << 19),
kString64_1 = (1 << 20), kString64_1 = (1u << 20),
kString64_2 = (1 << 21), kString64_2 = (1u << 21),
kString64_3 = (1 << 22), kString64_3 = (1u << 22),
kString64_4 = (1 << 23), kString64_4 = (1u << 23),
kString64_5 = (1 << 24), kString64_5 = (1u << 24),
kString64_6 = (1 << 25), kString64_6 = (1u << 25),
kIString64_1 = (1 << 26), kIString64_1 = (1u << 26),
kIString64_2 = (1 << 27), kIString64_2 = (1u << 27),
kText_1 = (1 << 28), kText_1 = (1u << 28),
kText_2 = (1 << 29), kText_2 = (1u << 29),
kBlob_1 = (1 << 30), kBlob_1 = (1u << 30),
kBlob_2 = (1 << 31), kBlob_2 = (1u << 31),
kValidFields = (kNodeId | kCreateTime | kModifyTime | kCreateAgeName | kCreateAgeUuid | kValidFields = (kNodeId | kCreateTime | kModifyTime | kCreateAgeName | kCreateAgeUuid |
kCreatorAcct | kCreatorId | kNodeType | kInt32_1 | kInt32_2 | kInt32_3 | kCreatorAcct | kCreatorId | kNodeType | kInt32_1 | kInt32_2 | kInt32_3 |

16
Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp

@ -1383,6 +1383,10 @@ void RelVaultNode::Print (const plString& tag, unsigned level) {
case k##flag: \ case k##flag: \
ss << ", " #flag "=\"" << Get##flag() << "\""; \ ss << ", " #flag "=\"" << Get##flag() << "\""; \
break; break;
#define STPRINT_UUID(flag) \
case k##flag: \
ss << ", " #flag "=\"" << Get##flag().AsString() << "\""; \
break;
#define STPRINT_ESCAPE(flag) \ #define STPRINT_ESCAPE(flag) \
case k##flag: \ case k##flag: \
ss << ", " #flag "=\"" << Get##flag().Replace("\"", "\\\"") << "\""; \ ss << ", " #flag "=\"" << Get##flag().Replace("\"", "\\\"") << "\""; \
@ -1397,8 +1401,8 @@ void RelVaultNode::Print (const plString& tag, unsigned level) {
STPRINT(CreateTime); STPRINT(CreateTime);
STPRINT(ModifyTime); STPRINT(ModifyTime);
STPRINT(CreateAgeName); STPRINT(CreateAgeName);
STPRINT(CreateAgeUuid); STPRINT_UUID(CreateAgeUuid);
STPRINT(CreatorAcct); STPRINT_UUID(CreatorAcct);
STPRINT(CreatorId); STPRINT(CreatorId);
STPRINT(NodeType); STPRINT(NodeType);
STPRINT(Int32_1); STPRINT(Int32_1);
@ -1409,10 +1413,10 @@ void RelVaultNode::Print (const plString& tag, unsigned level) {
STPRINT(UInt32_2); STPRINT(UInt32_2);
STPRINT(UInt32_3); STPRINT(UInt32_3);
STPRINT(UInt32_4); STPRINT(UInt32_4);
STPRINT(Uuid_1); STPRINT_UUID(Uuid_1);
STPRINT(Uuid_2); STPRINT_UUID(Uuid_2);
STPRINT(Uuid_3); STPRINT_UUID(Uuid_3);
STPRINT(Uuid_4); STPRINT_UUID(Uuid_4);
STPRINT_ESCAPE(String64_1); STPRINT_ESCAPE(String64_1);
STPRINT_ESCAPE(String64_2); STPRINT_ESCAPE(String64_2);
STPRINT_ESCAPE(String64_3); STPRINT_ESCAPE(String64_3);

2
cmake/CompilerChecks.cmake

@ -5,7 +5,7 @@ endif()
# Require C++11 # Require C++11
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) 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) if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif() endif()

Loading…
Cancel
Save