From 2da161fc85d1c2394afbae1ceccbdc999a8d7a70 Mon Sep 17 00:00:00 2001 From: nojhan Date: Tue, 10 Mar 2020 09:11:16 +0100 Subject: [PATCH] update eoRNG to fit C++17 standard ISO C++17 does not allow 'register' storage class specifier --- eo/src/utils/eoRNG.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/eo/src/utils/eoRNG.h b/eo/src/utils/eoRNG.h index ad5c440bf..0093d37da 100644 --- a/eo/src/utils/eoRNG.h +++ b/eo/src/utils/eoRNG.h @@ -483,9 +483,14 @@ inline void eoRng::initialize(uint32_t seed) { left = -1; + // ISO C++17 does not allow 'register' storage class specifier +#if __cplusplus < 201703L register uint32_t x = (seed | 1U) & 0xFFFFFFFFU, *s = state; register int j; - +#else + uint32_t x = (seed | 1U) & 0xFFFFFFFFU, *s = state; + int j; +#endif for(left=0, *s++=x, j=N; --j; *s++ = (x*=69069U) & 0xFFFFFFFFU) ; } @@ -494,8 +499,14 @@ inline void eoRng::initialize(uint32_t seed) inline uint32_t eoRng::restart() { + // ISO C++17 does not allow 'register' storage class specifier +#if __cplusplus < 201703L register uint32_t *p0=state, *p2=state+2, *pM=state+M, s0, s1; register int j; +#else + uint32_t *p0=state, *p2=state+2, *pM=state+M, s0, s1; + int j; +#endif left=N-1, next=state+1;