Bug 1266294 - Remove unnecessary compiler version checks for gcc <= 4.8.0 in mfbt. r=froydnj
authorChris Peterson <cpeterson@mozilla.com>
Sun, 17 Apr 2016 17:08:10 -0700
changeset 294433 5b1c09821da16aa3be4179465bc7519c5a5f40fa
parent 294432 b2cb9942d4343f6e2b4416cd5247be5908cdf0de
child 294434 7df8f4cd5d4aa4237d60bbdbc62a1e41186ee57b
push id75537
push usercpeterson@mozilla.com
push dateFri, 22 Apr 2016 05:54:49 +0000
treeherdermozilla-inbound@7df8f4cd5d4a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1266294
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1266294 - Remove unnecessary compiler version checks for gcc <= 4.8.0 in mfbt. r=froydnj
mfbt/Attributes.h
mfbt/Endian.h
mfbt/tests/TestMaybe.cpp
--- a/mfbt/Attributes.h
+++ b/mfbt/Attributes.h
@@ -82,19 +82,17 @@
 #    define MOZ_HAVE_NEVER_INLINE        __attribute__((noinline))
 #  endif
 #  if __has_attribute(noreturn)
 #    define MOZ_HAVE_NORETURN            __attribute__((noreturn))
 #  endif
 #elif defined(__GNUC__)
 #  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
 #    define MOZ_HAVE_CXX11_CONSTEXPR
-#    if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
-#      define MOZ_HAVE_CXX11_CONSTEXPR_IN_TEMPLATES
-#    endif
+#    define MOZ_HAVE_CXX11_CONSTEXPR_IN_TEMPLATES
 #    define MOZ_HAVE_EXPLICIT_CONVERSION
 #  endif
 #  define MOZ_HAVE_NEVER_INLINE          __attribute__((noinline))
 #  define MOZ_HAVE_NORETURN              __attribute__((noreturn))
 #endif
 
 /*
  * When built with clang analyzer (a.k.a scan-build), define MOZ_HAVE_NORETURN
--- a/mfbt/Endian.h
+++ b/mfbt/Endian.h
@@ -145,21 +145,19 @@
 #  error "Cannot determine endianness"
 #endif
 
 #if defined(__clang__)
 #  if __has_builtin(__builtin_bswap16)
 #    define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16
 #  endif
 #elif defined(__GNUC__)
-#  if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
-#    define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16
-#  endif
+#  define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16
 #elif defined(_MSC_VER)
-#    define MOZ_HAVE_BUILTIN_BYTESWAP16 _byteswap_ushort
+#  define MOZ_HAVE_BUILTIN_BYTESWAP16 _byteswap_ushort
 #endif
 
 namespace mozilla {
 
 namespace detail {
 
 /*
  * We need wrappers here because free functions with default template
--- a/mfbt/tests/TestMaybe.cpp
+++ b/mfbt/tests/TestMaybe.cpp
@@ -21,26 +21,16 @@ using mozilla::Nothing;
 using mozilla::Some;
 using mozilla::Swap;
 using mozilla::ToMaybe;
 using mozilla::UniquePtr;
 
 #if MOZ_IS_MSVC
    template<typename T> struct Identity { typedef T type; };
 #  define DECLTYPE(EXPR) Identity<decltype(EXPR)>::type
-#elif MOZ_IS_GCC
-// Work around a bug in GCC < 4.7 that prevents expressions of
-// the form |decltype(foo)::type| from working. See here:
-// http://stackoverflow.com/questions/14330768/c11-compiler-error-when-using-decltypevar-followed-by-internal-type-of-var
-#  if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
-#    define DECLTYPE(EXPR) decltype(EXPR)
-#  else
-     template<typename T> struct Identity { typedef T type; };
-#    define DECLTYPE(EXPR) Identity<decltype(EXPR)>::type
-#  endif
 #else
 #  define DECLTYPE(EXPR) decltype(EXPR)
 #endif
 
 #define RUN_TEST(t) \
   do { \
     bool cond = (t()); \
     if (!cond) \