[CMake] Require GCC 6
https://bugs.webkit.org/show_bug.cgi?id=184985

Reviewed by Alex Christensen.

.:

Require it.

* CMakeLists.txt:

Source/WebCore:

Remove a GCC 5 fallback path. This seems to be the only such fallback path in WebKit.

* platform/graphics/FourCC.h:
(WebCore::FourCC::FourCC):

Source/WTF:

Stop enforcing GCC version in Compiler.h. It's better to do this in the build system. And I
don't like having the same check in two different places.

* wtf/Compiler.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@231152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3fb3dd5..1903d6a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,8 +60,8 @@
 endif ()
 
 if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
-    if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "5.0.0")
-        message(FATAL_ERROR "GCC 5.0.0 is required to build WebKitGTK+, use a newer GCC version or clang")
+    if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "6.0.0")
+        message(FATAL_ERROR "GCC 6.0.0 is required to build WebKitGTK+, use a newer GCC version or clang")
     endif ()
 endif ()
 
diff --git a/ChangeLog b/ChangeLog
index 58ba7eb..652df6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2018-04-29  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [CMake] Require GCC 6
+        https://bugs.webkit.org/show_bug.cgi?id=184985
+
+        Reviewed by Alex Christensen.
+
+        Require it.
+
+        * CMakeLists.txt:
+
 2018-04-26  Daniel Bates  <dabates@apple.com>
 
         ASSERTION FAILED: ASSERT(!containsImage || MIMETypeRegistry::isSupportedImageResourceMIMEType([resource MIMEType])) in -[NSPasteboard(WebExtras) _web_writePromisedRTFDFromArchive:containsImage:]
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index 3da61f6..d7130ca 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,3 +1,15 @@
+2018-04-29  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [CMake] Require GCC 6
+        https://bugs.webkit.org/show_bug.cgi?id=184985
+
+        Reviewed by Alex Christensen.
+
+        Stop enforcing GCC version in Compiler.h. It's better to do this in the build system. And I
+        don't like having the same check in two different places.
+
+        * wtf/Compiler.h:
+
 2018-04-29  Geoffrey Garen  <ggaren@apple.com>
 
         WordLock doesn't need per-thread data
diff --git a/Source/WTF/wtf/Compiler.h b/Source/WTF/wtf/Compiler.h
index c26479c..1391ead 100644
--- a/Source/WTF/wtf/Compiler.h
+++ b/Source/WTF/wtf/Compiler.h
@@ -92,10 +92,6 @@
 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
 #define GCC_VERSION_AT_LEAST(major, minor, patch) (GCC_VERSION >= (major * 10000 + minor * 100 + patch))
 
-#if !GCC_VERSION_AT_LEAST(5, 0, 0)
-#error "Please use a newer version of GCC. WebKit requires GCC 5.0.0 or newer to compile."
-#endif
-
 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
 #define WTF_COMPILER_SUPPORTS_C_STATIC_ASSERT 1
 #endif
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 62a0340..b5a0741 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2018-04-29  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [CMake] Require GCC 6
+        https://bugs.webkit.org/show_bug.cgi?id=184985
+
+        Reviewed by Alex Christensen.
+
+        Remove a GCC 5 fallback path. This seems to be the only such fallback path in WebKit.
+
+        * platform/graphics/FourCC.h:
+        (WebCore::FourCC::FourCC):
+
 2018-04-29  Zalan Bujtas  <zalan@apple.com>
 
         [LFC] Implement Display::Box functions
diff --git a/Source/WebCore/platform/graphics/FourCC.h b/Source/WebCore/platform/graphics/FourCC.h
index 1afe051..e12ee52 100644
--- a/Source/WebCore/platform/graphics/FourCC.h
+++ b/Source/WebCore/platform/graphics/FourCC.h
@@ -27,46 +27,17 @@
 
 #include <wtf/text/WTFString.h>
 
-// FIXME: Remove this messy fallback path and require GCC 6 in May 2018.
-#if COMPILER(GCC)
-#if !GCC_VERSION_AT_LEAST(6, 0, 0)
-#define NEED_FOURCC_LEGACY_CONSTRUCTOR
-#include <cstring>
-#endif
-#endif
-
 namespace WebCore {
 
 struct FourCC {
     WEBCORE_EXPORT FourCC(uint32_t value) : value(value) { }
 
-#ifdef NEED_FOURCC_LEGACY_CONSTRUCTOR
-    // This constructor is risky because it creates ambiguous function
-    // calls that will not exist except with old versions of GCC: the
-    // initialization FourCC { 0 } is valid only when this legacy
-    // constructor is not enabled, because the uint32_t constructor and
-    // this constructor are equally-appropriate options. So the more
-    // verbose initialization FourCC { uint32_t { 0 } } is required, but
-    // developers will not realize this unless they use an old version of
-    // GCC. Bad.
-    FourCC(const char* data)
-    {
-        if (!data) {
-            value = 0;
-            return;
-        }
-        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(strlen(data) == 4);
-        value = data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3];
-    }
-#undef NEED_FOURCC_LEGACY_CONSTRUCTOR
-#else
     template<std::size_t N>
     constexpr FourCC(const char (&data)[N])
     {
         static_assert((N - 1) == 4, "FourCC literals must be exactly 4 characters long");
         value = data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3];
     }
-#endif
 
     String toString() const;
     WEBCORE_EXPORT static std::optional<FourCC> fromString(const String&);