From bc94bacce404401a480b6871eaa7bc38d766014c Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 9 Jan 2016 01:38:59 +0100 Subject: Core/Misc: Build fix for clang & libc++ --- src/common/Define.h | 6 ++++++ src/common/Utilities/Containers.h | 1 + src/common/Utilities/Random.h | 5 +++-- 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/common/Define.h b/src/common/Define.h index 3fa67a832a6..061a6bc2f5e 100644 --- a/src/common/Define.h +++ b/src/common/Define.h @@ -83,10 +83,16 @@ # define ATTR_NORETURN __attribute__((__noreturn__)) # define ATTR_PRINTF(F, V) __attribute__ ((__format__ (__printf__, F, V))) # define ATTR_DEPRECATED __attribute__((__deprecated__)) +# define TRINITY_CONSTEXPR constexpr #else //COMPILER != COMPILER_GNU # define ATTR_NORETURN # define ATTR_PRINTF(F, V) # define ATTR_DEPRECATED +#if _MSC_VER >= 1900 +# define TRINITY_CONSTEXPR constexpr +#else +# define TRINITY_CONSTEXPR +#endif #endif //COMPILER == COMPILER_GNU #define UI64FMTD "%" PRIu64 diff --git a/src/common/Utilities/Containers.h b/src/common/Utilities/Containers.h index c1e3ca9d8b0..4d523b736c7 100644 --- a/src/common/Utilities/Containers.h +++ b/src/common/Utilities/Containers.h @@ -20,6 +20,7 @@ #include "Define.h" #include "Random.h" +#include #include #include #include diff --git a/src/common/Utilities/Random.h b/src/common/Utilities/Random.h index 0219f61b5a8..dee0bfbfcf0 100644 --- a/src/common/Utilities/Random.h +++ b/src/common/Utilities/Random.h @@ -19,6 +19,7 @@ #define Random_h__ #include "Define.h" +#include #include /* Return a random number in the range min..max. */ @@ -62,8 +63,8 @@ class SFMTEngine public: typedef uint32 result_type; - result_type min() const { return std::numeric_limits::min(); } - result_type max() const { return std::numeric_limits::max(); } + static TRINITY_CONSTEXPR result_type min() { return std::numeric_limits::min(); } + static TRINITY_CONSTEXPR result_type max() { return std::numeric_limits::max(); } result_type operator()() const { return rand32(); } static SFMTEngine& Instance(); -- cgit v1.2.3