pcg: Make MSVC compatible

Still passes all tests of the test suite except for the tests for
a particular class size, which is an odd thing to test for anyway.
liquid_container
Nicolas Hake 2016-04-22 00:15:12 +02:00
parent 0fefc7abae
commit 02c8dc970a
3 changed files with 20 additions and 2 deletions

View File

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

View File

@ -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()();

View File

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