diff options
-rw-r--r-- | common/endian.h | 4 | ||||
-rw-r--r-- | common/math.h | 2 | ||||
-rw-r--r-- | common/ptr.h | 4 | ||||
-rw-r--r-- | common/scummsys.h | 2 | ||||
-rw-r--r-- | engines/sword25/util/lua/luaconf.h | 3 |
5 files changed, 7 insertions, 8 deletions
diff --git a/common/endian.h b/common/endian.h index 9cb703858a..1760dc74b2 100644 --- a/common/endian.h +++ b/common/endian.h @@ -86,7 +86,7 @@ } // Test for GCC >= 4.3.0 as this version added the bswap builtin -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) +#elif GCC_ATLEAST(4, 3) FORCEINLINE uint32 SWAP_BYTES_32(uint32 a) { return __builtin_bswap32(a); @@ -156,7 +156,7 @@ // // Moreover, we activate this code for GCC >= 3.3 but *only* if unaligned access // is allowed. -#if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3 && !defined(SCUMM_NEED_ALIGNMENT))) +#if GCC_ATLEAST(4, 0) || (GCC_ATLEAST(3, 3) && !defined(SCUMM_NEED_ALIGNMENT)) FORCEINLINE uint16 READ_UINT16(const void *ptr) { struct Unaligned16 { uint16 val; } __attribute__ ((__packed__, __may_alias__)); diff --git a/common/math.h b/common/math.h index f787b84fa6..b85ec0d22a 100644 --- a/common/math.h +++ b/common/math.h @@ -75,7 +75,7 @@ struct Complex { float re, im; }; -#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +#if GCC_ATLEAST(3, 4) inline int intLog2(uint32 v) { // This is a slightly optimized implementation of log2 for natural numbers // targeting gcc. It also saves some binary size over our fallback diff --git a/common/ptr.h b/common/ptr.h index 2b0670caae..725d97ec7e 100644 --- a/common/ptr.h +++ b/common/ptr.h @@ -103,7 +103,7 @@ private: */ template<class T> class SharedPtr { -#if !((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) +#if !defined __GNUC__ || GCC_ATLEAST(3, 0) template<class T2> friend class SharedPtr; #endif public: @@ -200,7 +200,7 @@ public: * This should just be used for debugging purposes. */ RefValue refCount() const { return _refCount ? *_refCount : 0; } -#if !((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) +#if !defined __GNUC__ || GCC_ATLEAST(3, 0) private: #endif void decRef() { diff --git a/common/scummsys.h b/common/scummsys.h index 85aaa46052..9cac6641c1 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -271,7 +271,7 @@ #ifndef FORCEINLINE #if defined(_MSC_VER) #define FORCEINLINE __forceinline - #elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) + #elif GCC_ATLEAST(3, 1) #define FORCEINLINE inline __attribute__((__always_inline__)) #else #define FORCEINLINE inline diff --git a/engines/sword25/util/lua/luaconf.h b/engines/sword25/util/lua/luaconf.h index 38ff9e1320..53d0f55290 100644 --- a/engines/sword25/util/lua/luaconf.h +++ b/engines/sword25/util/lua/luaconf.h @@ -182,8 +182,7 @@ #define LUAI_FUNC static #define LUAI_DATA /* empty */ -#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ - defined(__ELF__) && !defined(__PLAYSTATION2__) +#elif GCC_ATLEAST(3, 2) && defined(__ELF__) && !defined(__PLAYSTATION2__) /* ** The PS2 gcc compiler doesn't like the visibility attribute, so ** we use the normal "extern" definitions in the block below |