From 2bca45ef5b22c9d2727b2c382b0eec791e6de51a Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Tue, 18 Dec 2012 13:22:28 -0500 Subject: [PATCH] bug 822717 - remove checks for old gcc r=glandium --- dom/base/nsDOMClassInfoID.h | 3 +-- dom/plugins/ipc/PluginMessageUtils.h | 2 +- js/src/jsdhash.h | 2 +- js/src/jslibmath.h | 2 +- js/src/jstypes.h | 5 ++--- memory/mozalloc/mozalloc.cpp | 2 +- mfbt/Assertions.h | 3 +-- mfbt/Attributes.h | 4 +--- mfbt/Likely.h | 2 +- xpcom/base/nscore.h | 5 ++--- xpcom/ds/nsMathUtils.h | 2 +- xpcom/glue/arm.h | 13 +------------ xpcom/glue/nsCOMPtr.h | 2 +- xpcom/glue/pldhash.h | 2 +- .../xptcall/src/md/unix/xptcinvoke_arm_openbsd.cpp | 2 +- xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp | 2 +- .../xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp | 2 +- 17 files changed, 19 insertions(+), 36 deletions(-) diff --git a/dom/base/nsDOMClassInfoID.h b/dom/base/nsDOMClassInfoID.h index 097bc2eb290a..84d12ca7cab6 100644 --- a/dom/base/nsDOMClassInfoID.h +++ b/dom/base/nsDOMClassInfoID.h @@ -93,8 +93,7 @@ class EventTarget; * but it does the job adequately for our purposes. */ -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2) || \ - _MSC_FULL_VER >= 140050215 +#if defined(__GNUC__) || _MSC_FULL_VER >= 140050215 /* Use a compiler intrinsic if one is available. */ diff --git a/dom/plugins/ipc/PluginMessageUtils.h b/dom/plugins/ipc/PluginMessageUtils.h index f4f09447e4ae..23da0f233ed8 100644 --- a/dom/plugins/ipc/PluginMessageUtils.h +++ b/dom/plugins/ipc/PluginMessageUtils.h @@ -67,7 +67,7 @@ inline bool IsDrawingModelAsync(int16_t aModel) { #if defined(_MSC_VER) #define FULLFUNCTION __FUNCSIG__ -#elif (__GNUC__ >= 4) +#elif defined(__GNUC__) #define FULLFUNCTION __PRETTY_FUNCTION__ #else #define FULLFUNCTION __FUNCTION__ diff --git a/js/src/jsdhash.h b/js/src/jsdhash.h index 9553658b57e4..d2a474cb93e1 100644 --- a/js/src/jsdhash.h +++ b/js/src/jsdhash.h @@ -14,7 +14,7 @@ #include "jstypes.h" #include "jsutil.h" -#if defined(__GNUC__) && defined(__i386__) && (__GNUC__ >= 3) && !defined(XP_OS2) +#if defined(__GNUC__) && defined(__i386__) && !defined(XP_OS2) #define JS_DHASH_FASTCALL __attribute__ ((regparm (3),stdcall)) #elif defined(XP_WIN) #define JS_DHASH_FASTCALL __fastcall diff --git a/js/src/jslibmath.h b/js/src/jslibmath.h index b17b48ab8102..778d7f8ae1de 100644 --- a/js/src/jslibmath.h +++ b/js/src/jslibmath.h @@ -18,7 +18,7 @@ */ /* The right copysign function is not always named the same thing. */ -#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +#ifdef __GNUC__ #define js_copysign __builtin_copysign #elif defined _WIN32 #define js_copysign _copysign diff --git a/js/src/jstypes.h b/js/src/jstypes.h index 90f5d44a645b..c83e7fed26e3 100644 --- a/js/src/jstypes.h +++ b/js/src/jstypes.h @@ -74,8 +74,7 @@ #if defined(_MSC_VER) && defined(_M_IX86) #define JS_FASTCALL __fastcall -#elif defined(__GNUC__) && defined(__i386__) && \ - ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +#elif defined(__GNUC__) && defined(__i386__) #define JS_FASTCALL __attribute__((fastcall)) #else #define JS_FASTCALL @@ -209,7 +208,7 @@ typedef int JSBool; ** } ** ***********************************************************************/ -#if defined(__GNUC__) && (__GNUC__ > 2) +#ifdef __GNUC__ # define JS_LIKELY(x) (__builtin_expect((x), 1)) # define JS_UNLIKELY(x) (__builtin_expect((x), 0)) diff --git a/memory/mozalloc/mozalloc.cpp b/memory/mozalloc/mozalloc.cpp index 5b3399ad6527..5da9943726c0 100644 --- a/memory/mozalloc/mozalloc.cpp +++ b/memory/mozalloc/mozalloc.cpp @@ -34,7 +34,7 @@ extern "C" size_t malloc_usable_size(const void *ptr); #endif -#if defined(__GNUC__) && (__GNUC__ > 2) +#ifdef __GNUC__ #define LIKELY(x) (__builtin_expect(!!(x), 1)) #define UNLIKELY(x) (__builtin_expect(!!(x), 0)) #else diff --git a/mfbt/Assertions.h b/mfbt/Assertions.h index 407fb24e98d1..ba949ce6a3a9 100644 --- a/mfbt/Assertions.h +++ b/mfbt/Assertions.h @@ -61,8 +61,7 @@ # define MOZ_STATIC_ASSERT(cond, reason) static_assert((cond), reason) # endif # elif defined(__GNUC__) -# if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) && \ - (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) +# if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) # define MOZ_STATIC_ASSERT(cond, reason) static_assert((cond), reason) # endif # elif defined(_MSC_VER) diff --git a/mfbt/Attributes.h b/mfbt/Attributes.h index ca990be15a06..5ec4023ed776 100644 --- a/mfbt/Attributes.h +++ b/mfbt/Attributes.h @@ -91,9 +91,7 @@ # define MOZ_HAVE_CXX11_OVERRIDE # define MOZ_HAVE_CXX11_FINAL final # endif -# if __GNUC_MINOR__ >= 4 -# define MOZ_HAVE_CXX11_DELETE -# endif +# define MOZ_HAVE_CXX11_DELETE # if __GNUC_MINOR__ >= 5 # define MOZ_HAVE_CXX11_ENUM_TYPE # define MOZ_HAVE_CXX11_STRONG_ENUMS diff --git a/mfbt/Likely.h b/mfbt/Likely.h index f22a14e882b6..6412b4943b19 100644 --- a/mfbt/Likely.h +++ b/mfbt/Likely.h @@ -11,7 +11,7 @@ #ifndef mozilla_Likely_h_ #define mozilla_Likely_h_ -#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 2)) +#if defined(__clang__) || defined(__GNUC__) # define MOZ_LIKELY(x) (__builtin_expect(!!(x), 1)) # define MOZ_UNLIKELY(x) (__builtin_expect(!!(x), 0)) #else diff --git a/xpcom/base/nscore.h b/xpcom/base/nscore.h index 5a404ca9028d..8ea5031c79bf 100644 --- a/xpcom/base/nscore.h +++ b/xpcom/base/nscore.h @@ -117,8 +117,7 @@ typedef size_t(*nsMallocSizeOfFun)(const void *p); * NS_HIDDEN_(int) NS_FASTCALL func2(char *foo); */ -#if defined(__i386__) && defined(__GNUC__) && \ - (__GNUC__ >= 3) && !defined(XP_OS2) +#if defined(__i386__) && defined(__GNUC__) && !defined(XP_OS2) #define NS_FASTCALL __attribute__ ((regparm (3), stdcall)) #define NS_CONSTRUCTOR_FASTCALL __attribute__ ((regparm (3), stdcall)) #elif defined(XP_WIN) && !defined(_WIN64) @@ -212,7 +211,7 @@ typedef size_t(*nsMallocSizeOfFun)(const void *p); /** * Deprecated declarations. */ -#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) +#ifdef __GNUC__ # define MOZ_DEPRECATED __attribute__((deprecated)) #elif defined(_MSC_VER) # define MOZ_DEPRECATED __declspec(deprecated) diff --git a/xpcom/ds/nsMathUtils.h b/xpcom/ds/nsMathUtils.h index 6e560377eb79..fdb93006701a 100644 --- a/xpcom/ds/nsMathUtils.h +++ b/xpcom/ds/nsMathUtils.h @@ -80,7 +80,7 @@ inline NS_HIDDEN_(int32_t) NS_lroundf(float x) */ inline NS_HIDDEN_(double) NS_hypot(double x, double y) { -#if __GNUC__ >= 4 +#ifdef __GNUC__ return __builtin_hypot(x, y); #elif defined _WIN32 return _hypot(x, y); diff --git a/xpcom/glue/arm.h b/xpcom/glue/arm.h index fa0f25088541..e0bcba8f3f9a 100644 --- a/xpcom/glue/arm.h +++ b/xpcom/glue/arm.h @@ -53,28 +53,17 @@ # endif -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# ifdef __GNUC__ # define MOZILLA_MAY_SUPPORT_EDSP 1 -# endif -# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) # if defined(HAVE_ARM_SIMD) # define MOZILLA_MAY_SUPPORT_ARMV6 1 # endif -# endif - // Technically 4.2.x only works in the CodeSourcery releases, but I don't - // know how to detect those separately from mainline gcc (which got support - // in 4.3). The Maemo version 5 SDK shipped with the CodeSourcery 4.2.1 - // release, which we need to work. -# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) # if defined(HAVE_ARM_NEON) # define MOZILLA_MAY_SUPPORT_NEON 1 # endif -# endif - // ARMv7 support was merged in gcc 4.3. -# if __GNUC__> 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) # if defined(HAVE_ARM_SIMD) # define MOZILLA_MAY_SUPPORT_ARMV7 1 # endif diff --git a/xpcom/glue/nsCOMPtr.h b/xpcom/glue/nsCOMPtr.h index d09faf6cd6e8..c1c165fcb36a 100644 --- a/xpcom/glue/nsCOMPtr.h +++ b/xpcom/glue/nsCOMPtr.h @@ -76,7 +76,7 @@ #undef NSCAP_FEATURE_TEST_DONTQUERY_CASES #endif -#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) +#ifdef __GNUC__ // Our use of nsCOMPtr_base::mRawPtr violates the C++ standard's aliasing // rules. Mark it with the may_alias attribute so that gcc 3.3 and higher // don't reorder instructions based on aliasing assumptions for diff --git a/xpcom/glue/pldhash.h b/xpcom/glue/pldhash.h index be73a314bb04..5543a51817b4 100644 --- a/xpcom/glue/pldhash.h +++ b/xpcom/glue/pldhash.h @@ -17,7 +17,7 @@ extern "C" { #endif -#if defined(__GNUC__) && defined(__i386__) && (__GNUC__ >= 3) && !defined(XP_OS2) +#if defined(__GNUC__) && defined(__i386__) && !defined(XP_OS2) #define PL_DHASH_FASTCALL __attribute__ ((regparm (3),stdcall)) #elif defined(XP_WIN) #define PL_DHASH_FASTCALL __fastcall diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm_openbsd.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm_openbsd.cpp index 24b4ce4effe6..4ec7dd20fb5d 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm_openbsd.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm_openbsd.cpp @@ -140,7 +140,7 @@ NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex, * */ -#if (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 8)) +#ifdef __GNUC__ __asm__ __volatile__( "ldr r1, [%1, #12] \n\t" /* prepare to call invoke_count_words */ "ldr ip, [%1, #16] \n\t" /* r0=paramCount, r1=params */ diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp index 89897a17e972..ea70b01ce05b 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp @@ -12,7 +12,7 @@ #error "This code is for Linux ARM only. Please check if it works for you, too.\nDepends strongly on gcc behaviour." #endif -#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4)) +#ifdef __GNUC__ /* This tells gcc3.4+ not to optimize away symbols. * @see http://gcc.gnu.org/gcc-3.4/changes.html */ diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp index 0216a8c732bb..8e3ea6c6e415 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp @@ -8,7 +8,7 @@ #include "xptcprivate.h" #include "xptiprivate.h" -#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4)) +#ifdef __GNUC__ /* This tells gcc3.4+ not to optimize away symbols. * @see http://gcc.gnu.org/gcc-3.4/changes.html */