From a64b5e2a778333916d6f4b47dc679eba6d34be09 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Thu, 15 Mar 2012 10:16:45 +0100 Subject: ALL: Use GCC_ATLEAST(). --- common/endian.h | 4 ++-- common/math.h | 2 +- common/ptr.h | 4 ++-- common/scummsys.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'common') 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 SharedPtr { -#if !((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) +#if !defined __GNUC__ || GCC_ATLEAST(3, 0) template 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 -- cgit v1.2.3