Permalink
Browse files

ALL: Use GCC_ATLEAST().

  • Loading branch information...
1 parent 757fa01 commit a64b5e2a778333916d6f4b47dc679eba6d34be09 @chmallon chmallon committed with lordhoto Mar 15, 2012
Showing with 7 additions and 8 deletions.
  1. +2 −2 common/endian.h
  2. +1 −1 common/math.h
  3. +2 −2 common/ptr.h
  4. +1 −1 common/scummsys.h
  5. +1 −2 engines/sword25/util/lua/luaconf.h
View
4 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__));
View
2 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
View
4 common/ptr.h
@@ -103,7 +103,7 @@ class SharedPtrDeletionDeleterImpl : public SharedPtrDeletionInternal {
*/
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 @@ class SharedPtr {
* 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() {
View
2 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
View
3 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

0 comments on commit a64b5e2

Please sign in to comment.