diff --git a/thirdparty/pcg/pcg_extras.hpp b/thirdparty/pcg/pcg_extras.hpp index ec3e5694e..2e39874db 100644 --- a/thirdparty/pcg/pcg_extras.hpp +++ b/thirdparty/pcg/pcg_extras.hpp @@ -21,6 +21,11 @@ * http://www.pcg-random.org */ +/* + * Modified by The OpenClonk.org Project to improve compatibility with + * Microsoft Visual C++. + */ + /* * This file provides support code that is useful for random-number generation * but not specific to the PCG generation scheme, including: @@ -58,8 +63,10 @@ #ifdef __GNUC__ #define PCG_NOINLINE __attribute__((noinline)) + #define PCG_ALWAYS_INLINE __attribute__((always_inline)) #else #define PCG_NOINLINE + #define PCG_ALWAYS_INLINE #endif /* diff --git a/thirdparty/pcg/pcg_random.hpp b/thirdparty/pcg/pcg_random.hpp index 3f04d854e..9575d1401 100644 --- a/thirdparty/pcg/pcg_random.hpp +++ b/thirdparty/pcg/pcg_random.hpp @@ -21,6 +21,11 @@ * http://www.pcg-random.org */ +/* + * Modified by The OpenClonk.org Project to improve compatibility with + * Microsoft Visual C++. + */ + /* * This code provides the reference implementation of the PCG family of * random number generators. The code is complex because it implements @@ -1203,7 +1208,7 @@ public: return baseclass::period_pow2() + table_size*extvalclass::period_pow2(); } - __attribute__((always_inline)) result_type operator()() + PCG_ALWAYS_INLINE result_type operator()() { result_type rhs = get_extended_value(); result_type lhs = this->baseclass::operator()(); diff --git a/thirdparty/pcg/pcg_uint128.hpp b/thirdparty/pcg/pcg_uint128.hpp index 99b20e780..12162bb5c 100644 --- a/thirdparty/pcg/pcg_uint128.hpp +++ b/thirdparty/pcg/pcg_uint128.hpp @@ -21,6 +21,11 @@ * http://www.pcg-random.org */ +/* + * Modified by The OpenClonk.org Project to improve compatibility with + * Microsoft Visual C++. + */ + /* * This code provides a a C++ class that can provide 128-bit (or higher) * integers. To produce 2K-bit integers, it uses two K-bit integers, @@ -65,7 +70,8 @@ #define PCG_LITTLE_ENDIAN 1 #elif __BIG_ENDIAN__ || _BIG_ENDIAN #define PCG_LITTLE_ENDIAN 0 - #elif __x86_64 || __x86_64__ || __i386 || __i386__ + #elif __x86_64 || __x86_64__ || __i386 || __i386__ \ + || _M_X64 || _M_IX86 || _M_ARM || _M_IA64 #define PCG_LITTLE_ENDIAN 1 #elif __powerpc__ || __POWERPC__ || __ppc__ || __PPC__ \ || __m68k__ || __mc68000__