Core/Misc: Build fix for clang & libc++

This commit is contained in:
Shauren
2016-01-09 01:38:59 +01:00
parent 53f768bd2a
commit bc94bacce4
3 changed files with 10 additions and 2 deletions

View File

@@ -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

View File

@@ -20,6 +20,7 @@
#include "Define.h"
#include "Random.h"
#include <algorithm>
#include <functional>
#include <list>
#include <vector>

View File

@@ -19,6 +19,7 @@
#define Random_h__
#include "Define.h"
#include <limits>
#include <random>
/* 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<result_type>::min(); }
result_type max() const { return std::numeric_limits<result_type>::max(); }
static TRINITY_CONSTEXPR result_type min() { return std::numeric_limits<result_type>::min(); }
static TRINITY_CONSTEXPR result_type max() { return std::numeric_limits<result_type>::max(); }
result_type operator()() const { return rand32(); }
static SFMTEngine& Instance();