Multiple GCC 10 build failures in ANGLE
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Feb 2020 00:31:41 +0000 (00:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Feb 2020 00:31:41 +0000 (00:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=207365

Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2020-02-12
Reviewed by Carlos Alberto Lopez Perez.

* changes.diff: Updated.
* include/platform/Platform.h: Add missing #include to get size_t.
* src/common/PackedEnums.h: Remove problematic const_casts.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256491 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/ThirdParty/ANGLE/ChangeLog
Source/ThirdParty/ANGLE/changes.diff
Source/ThirdParty/ANGLE/include/platform/Platform.h
Source/ThirdParty/ANGLE/src/common/PackedEnums.h

index c08b6c8..c6a1479 100644 (file)
@@ -1,3 +1,14 @@
+2020-02-12  Michael Catanzaro  <mcatanzaro@gnome.org>
+
+        Multiple GCC 10 build failures in ANGLE
+        https://bugs.webkit.org/show_bug.cgi?id=207365
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        * changes.diff: Updated.
+        * include/platform/Platform.h: Add missing #include to get size_t.
+        * src/common/PackedEnums.h: Remove problematic const_casts.
+
 2020-02-12  Dean Jackson  <dino@apple.com>
 
         ANGLE has unused bison and glmark2 code
index 6875be8..9655f75 100644 (file)
@@ -9908,3 +9908,31 @@ index a73592113f1..00000000000
 @@ -1 +0,0 @@
 -212a9ef90e21a98ff57ca301a60c84cbeca7be28
 \ No newline at end of file
+diff --git a/include/platform/Platform.h b/include/platform/Platform.h
+index b603ff9bad2..f4ec4f8837c 100644
+--- a/include/platform/Platform.h
++++ b/include/platform/Platform.h
+@@ -9,6 +9,7 @@
+ #ifndef ANGLE_PLATFORM_H
+ #define ANGLE_PLATFORM_H
++#include <stdlib.h>
+ #include <stdint.h>
+ #include <array>
+diff --git a/src/common/PackedEnums.h b/src/common/PackedEnums.h
+index bd5fc340dcc..63368e25dfe 100644
+--- a/src/common/PackedEnums.h
++++ b/src/common/PackedEnums.h
+@@ -83,10 +83,7 @@ class PackedEnumMap
+         // We use a for loop instead of range-for to work around a limitation in MSVC.
+         for (const InitPair *it = init.begin(); it != init.end(); ++it)
+         {
+-            // This horrible const_cast pattern is necessary to work around a constexpr limitation.
+-            // See https://stackoverflow.com/q/34199774/ . Note that it should be fixed with C++17.
+-            const_cast<T &>(const_cast<const Storage &>(
+-                mPrivateData)[static_cast<UnderlyingType>(it->first)]) = it->second;
++            mPrivateData[static_cast<UnderlyingType>(it->first)] = it->second;
+         }
+     }
index b603ff9..f4ec4f8 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef ANGLE_PLATFORM_H
 #define ANGLE_PLATFORM_H
 
+#include <stdlib.h>
 #include <stdint.h>
 #include <array>
 
index bd5fc34..6fcfce5 100644 (file)
@@ -83,10 +83,7 @@ class PackedEnumMap
         // We use a for loop instead of range-for to work around a limitation in MSVC.
         for (const InitPair *it = init.begin(); it != init.end(); ++it)
         {
-            // This horrible const_cast pattern is necessary to work around a constexpr limitation.
-            // See https://stackoverflow.com/q/34199774/ . Note that it should be fixed with C++17.
-            const_cast<T &>(const_cast<const Storage &>(
-                mPrivateData)[static_cast<UnderlyingType>(it->first)]) = it->second;
+            mPrivateData[static_cast<UnderlyingType>(it->first)] = it->second;
         }
     }