From badba34e28333a8488bf74dbe05a7c6945df5623 Mon Sep 17 00:00:00 2001 From: sanctum32 Date: Tue, 31 Dec 2013 04:53:26 +0200 Subject: [PATCH] [12775] Final fix for clang compiler --- src/framework/Platform/CompilerDefs.h | 7 +++++++ src/game/ObjectMgr.h | 2 +- src/game/Unit.h | 2 +- src/shared/revision_nr.h | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/framework/Platform/CompilerDefs.h b/src/framework/Platform/CompilerDefs.h index 4bd19d16c..223af682e 100644 --- a/src/framework/Platform/CompilerDefs.h +++ b/src/framework/Platform/CompilerDefs.h @@ -63,4 +63,11 @@ # pragma warning( disable : 4267 ) // conversion from 'size_t' to 'int', possible loss of data # pragma warning( disable : 4786 ) // identifier was truncated to '255' characters in the debug information #endif + +#if defined( __clang__) +#define COMPILE_ASSERT(exp, name) _Static_assert((exp), #name) +#else +#define COMPILE_ASSERT(exp, name) static_assert((exp), #name) +#endif + #endif diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index d7b34920d..599b96aeb 100755 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -131,7 +131,7 @@ typedef UNORDERED_MAP < uint32/*(mapid,spawnMode) pair*/, CellObjectGuidsMap > M #define MAX_CREATURE_AI_TEXT_STRING_ID (-1000000) // Anything below MAX_CREATURE_AI_TEXT_STRING_ID is handled by the external script lib -static_assert(MAX_DB_SCRIPT_STRING_ID < ACE_INT32_MAX, "Must scope with int32 range"); +COMPILE_ASSERT(MAX_DB_SCRIPT_STRING_ID < ACE_INT32_MAX, "Must scope with int32 range"); struct MangosStringLocale { diff --git a/src/game/Unit.h b/src/game/Unit.h index 8df301dd9..bee16d0a5 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -401,7 +401,7 @@ enum UnitMods UNIT_MOD_POWER_END = UNIT_MOD_ALTERNATIVE + 1 }; -static_assert(UNIT_MOD_POWER_END - UNIT_MOD_POWER_START == MAX_POWERS, "Power-related UnitMods are not updated."); +COMPILE_ASSERT(UNIT_MOD_POWER_END - UNIT_MOD_POWER_START == MAX_POWERS, "Power-related UnitMods are not updated."); enum BaseModGroup { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 5a5f85540..1353f4b98 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12774" + #define REVISION_NR "12775" #endif // __REVISION_NR_H__