Title: [275616] trunk/Source/ThirdParty
Revision
275616
Author
[email protected]
Date
2021-04-07 11:23:36 -0700 (Wed, 07 Apr 2021)

Log Message

[PlayStation] Do not include <any> in gtest because it requires RTTI
https://bugs.webkit.org/show_bug.cgi?id=224281

Reviewed by Ross Kirsling.

To determine platform capabilities gtest looks to see if a platform is using a minimum
C++ version and whether it has a required header. In the PlayStation's case it sees that
the <any> header is present with the requisite version of C++ so it defines support for it
and includes the header. However in the PlayStation's case to use <any> RTTI must be
enabled and if it isn't an error is generated.

This patch adds a way to short circuit GTEST_INTERNAL values for ports. An upstream fix is
in review at https://github.com/google/googletest/pull/3345 and if landed then the next
update to gtest can remove this patch.

* gtest/PlatformPlayStation.cmake:
* gtest/README.WebKit: Added.
* gtest/include/gtest/internal/gtest-port.h:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/ThirdParty/ChangeLog (275615 => 275616)


--- trunk/Source/ThirdParty/ChangeLog	2021-04-07 18:22:29 UTC (rev 275615)
+++ trunk/Source/ThirdParty/ChangeLog	2021-04-07 18:23:36 UTC (rev 275616)
@@ -1,5 +1,26 @@
 2021-04-07  Don Olmstead  <[email protected]>
 
+        [PlayStation] Do not include <any> in gtest because it requires RTTI
+        https://bugs.webkit.org/show_bug.cgi?id=224281
+
+        Reviewed by Ross Kirsling.
+
+        To determine platform capabilities gtest looks to see if a platform is using a minimum
+        C++ version and whether it has a required header. In the PlayStation's case it sees that
+        the <any> header is present with the requisite version of C++ so it defines support for it
+        and includes the header. However in the PlayStation's case to use <any> RTTI must be
+        enabled and if it isn't an error is generated.
+
+        This patch adds a way to short circuit GTEST_INTERNAL values for ports. An upstream fix is
+        in review at https://github.com/google/googletest/pull/3345 and if landed then the next
+        update to gtest can remove this patch.
+
+        * gtest/PlatformPlayStation.cmake:
+        * gtest/README.WebKit: Added.
+        * gtest/include/gtest/internal/gtest-port.h:
+
+2021-04-07  Don Olmstead  <[email protected]>
+
         [CMake] Add WebKit::gtest target
         https://bugs.webkit.org/show_bug.cgi?id=224203
 

Modified: trunk/Source/ThirdParty/gtest/PlatformPlayStation.cmake (275615 => 275616)


--- trunk/Source/ThirdParty/gtest/PlatformPlayStation.cmake	2021-04-07 18:22:29 UTC (rev 275615)
+++ trunk/Source/ThirdParty/gtest/PlatformPlayStation.cmake	2021-04-07 18:23:36 UTC (rev 275616)
@@ -3,6 +3,7 @@
 list(APPEND gtest_DEFINITIONS
     GTEST_HAS_POSIX_RE=0
     GTEST_HAS_TR1_TUPLE=0
+    GTEST_INTERNAL_HAS_ANY=0
 )
 
 # localtime_r isn't available so map to localtime_s

Added: trunk/Source/ThirdParty/gtest/README.WebKit (0 => 275616)


--- trunk/Source/ThirdParty/gtest/README.WebKit	                        (rev 0)
+++ trunk/Source/ThirdParty/gtest/README.WebKit	2021-04-07 18:23:36 UTC (rev 275616)
@@ -0,0 +1,9 @@
+GTest @ 1a8ecf1
+
+https://github.com/google/googletest/commit/1a8ecf1813d022cc7914e04564b92decff6161fc
+
+
+2021-04-05 Don Olmstead
+    Allow a port to set GTEST_INTERNAL values manually
+
+    https://github.com/google/googletest/pull/3345

Modified: trunk/Source/ThirdParty/gtest/include/gtest/internal/gtest-port.h (275615 => 275616)


--- trunk/Source/ThirdParty/gtest/include/gtest/internal/gtest-port.h	2021-04-07 18:22:29 UTC (rev 275615)
+++ trunk/Source/ThirdParty/gtest/include/gtest/internal/gtest-port.h	2021-04-07 18:23:36 UTC (rev 275616)
@@ -2277,11 +2277,16 @@
 }  // namespace internal
 }  // namespace testing
 #else
+#if !defined(GTEST_INTERNAL_HAS_ANY)
 #ifdef __has_include
 #if __has_include(<any>) && __cplusplus >= 201703L
 // Otherwise for C++17 and higher use std::any for UniversalPrinter<>
 // specializations.
 #define GTEST_INTERNAL_HAS_ANY 1
+#endif  // __has_include(<any>) && __cplusplus >= 201703L
+#endif  // __has_include
+#endif  // !defined(GTEST_INTERNAL_HAS_ANY)
+#if GTEST_INTERNAL_HAS_ANY
 #include <any>
 namespace testing {
 namespace internal {
@@ -2290,8 +2295,7 @@
 }  // namespace testing
 // The case where absl is configured NOT to alias std::any is not
 // supported.
-#endif  // __has_include(<any>) && __cplusplus >= 201703L
-#endif  // __has_include
+#endif  // GTEST_INTERNAL_HAS_ANY
 #endif  // GTEST_HAS_ABSL
 
 #if GTEST_HAS_ABSL
@@ -2306,11 +2310,16 @@
 }  // namespace internal
 }  // namespace testing
 #else
+#if !defined(GTEST_INTERNAL_HAS_OPTIONAL)
 #ifdef __has_include
 #if __has_include(<optional>) && __cplusplus >= 201703L
 // Otherwise for C++17 and higher use std::optional for UniversalPrinter<>
 // specializations.
 #define GTEST_INTERNAL_HAS_OPTIONAL 1
+#endif  // __has_include(<optional>) && __cplusplus >= 201703L
+#endif  // __has_include
+#endif  // !defined(GTEST_INTERNAL_HAS_OPTIONAL)
+#if GTEST_INTERNAL_HAS_OPTIONAL
 #include <optional>
 namespace testing {
 namespace internal {
@@ -2320,8 +2329,7 @@
 }  // namespace testing
 // The case where absl is configured NOT to alias std::optional is not
 // supported.
-#endif  // __has_include(<optional>) && __cplusplus >= 201703L
-#endif  // __has_include
+#endif  // GTEST_INTERNAL_HAS_OPTIONAL
 #endif  // GTEST_HAS_ABSL
 
 #if GTEST_HAS_ABSL
@@ -2335,11 +2343,16 @@
 }  // namespace internal
 }  // namespace testing
 #else
-# ifdef __has_include
-#   if __has_include(<string_view>) && __cplusplus >= 201703L
+#if !defined(GTEST_INTERNAL_HAS_STRING_VIEW)
+#ifdef __has_include
+#if __has_include(<string_view>) && __cplusplus >= 201703L
 // Otherwise for C++17 and higher use std::string_view for Matcher<>
 // specializations.
-#   define GTEST_INTERNAL_HAS_STRING_VIEW 1
+#define GTEST_INTERNAL_HAS_STRING_VIEW 1
+#endif  // __has_include(<string_view>) && __cplusplus >= 201703L
+#endif  // __has_include
+#endif  // !defined(GTEST_INTERNAL_HAS_STRING_VIEW)
+#if GTEST_INTERNAL_HAS_STRING_VIEW
 #include <string_view>
 namespace testing {
 namespace internal {
@@ -2348,8 +2361,7 @@
 }  // namespace testing
 // The case where absl is configured NOT to alias std::string_view is not
 // supported.
-#  endif  // __has_include(<string_view>) && __cplusplus >= 201703L
-# endif  // __has_include
+#endif  // GTEST_INTERNAL_HAS_STRING_VIEW
 #endif  // GTEST_HAS_ABSL
 
 #if GTEST_HAS_ABSL
@@ -2364,11 +2376,16 @@
 }  // namespace internal
 }  // namespace testing
 #else
+#if !defined(GTEST_INTERNAL_HAS_VARIANT)
 #ifdef __has_include
 #if __has_include(<variant>) && __cplusplus >= 201703L
 // Otherwise for C++17 and higher use std::variant for UniversalPrinter<>
 // specializations.
 #define GTEST_INTERNAL_HAS_VARIANT 1
+#endif  // __has_include(<variant>) && __cplusplus >= 201703L
+#endif  // __has_include
+#endif  // !defined(GTEST_INTERNAL_HAS_VARIANT)
+#if GTEST_INTERNAL_HAS_VARIANT
 #include <variant>
 namespace testing {
 namespace internal {
@@ -2377,8 +2394,7 @@
 }  // namespace internal
 }  // namespace testing
 // The case where absl is configured NOT to alias std::variant is not supported.
-#endif  // __has_include(<variant>) && __cplusplus >= 201703L
-#endif  // __has_include
+#endif  // GTEST_INTERNAL_HAS_VARIANT
 #endif  // GTEST_HAS_ABSL
 
 #endif  // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to