Changeset 275616 in webkit


Ignore:
Timestamp:
Apr 7, 2021 11:23:36 AM (3 years ago)
Author:
don.olmstead@sony.com
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:
Location:
trunk/Source/ThirdParty
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/ThirdParty/ChangeLog

    r275602 r275616  
     12021-04-07  Don Olmstead  <don.olmstead@sony.com>
     2
     3        [PlayStation] Do not include <any> in gtest because it requires RTTI
     4        https://bugs.webkit.org/show_bug.cgi?id=224281
     5
     6        Reviewed by Ross Kirsling.
     7
     8        To determine platform capabilities gtest looks to see if a platform is using a minimum
     9        C++ version and whether it has a required header. In the PlayStation's case it sees that
     10        the <any> header is present with the requisite version of C++ so it defines support for it
     11        and includes the header. However in the PlayStation's case to use <any> RTTI must be
     12        enabled and if it isn't an error is generated.
     13
     14        This patch adds a way to short circuit GTEST_INTERNAL values for ports. An upstream fix is
     15        in review at https://github.com/google/googletest/pull/3345 and if landed then the next
     16        update to gtest can remove this patch.
     17
     18        * gtest/PlatformPlayStation.cmake:
     19        * gtest/README.WebKit: Added.
     20        * gtest/include/gtest/internal/gtest-port.h:
     21
    1222021-04-07  Don Olmstead  <don.olmstead@sony.com>
    223
  • trunk/Source/ThirdParty/gtest/PlatformPlayStation.cmake

    r275602 r275616  
    44    GTEST_HAS_POSIX_RE=0
    55    GTEST_HAS_TR1_TUPLE=0
     6    GTEST_INTERNAL_HAS_ANY=0
    67)
    78
  • trunk/Source/ThirdParty/gtest/include/gtest/internal/gtest-port.h

    r274887 r275616  
    22782278}  // namespace testing
    22792279#else
     2280#if !defined(GTEST_INTERNAL_HAS_ANY)
    22802281#ifdef __has_include
    22812282#if __has_include(<any>) && __cplusplus >= 201703L
     
    22832284// specializations.
    22842285#define GTEST_INTERNAL_HAS_ANY 1
     2286#endif  // __has_include(<any>) && __cplusplus >= 201703L
     2287#endif  // __has_include
     2288#endif  // !defined(GTEST_INTERNAL_HAS_ANY)
     2289#if GTEST_INTERNAL_HAS_ANY
    22852290#include <any>
    22862291namespace testing {
     
    22912296// The case where absl is configured NOT to alias std::any is not
    22922297// supported.
    2293 #endif  // __has_include(<any>) && __cplusplus >= 201703L
    2294 #endif  // __has_include
     2298#endif  // GTEST_INTERNAL_HAS_ANY
    22952299#endif  // GTEST_HAS_ABSL
    22962300
     
    23072311}  // namespace testing
    23082312#else
     2313#if !defined(GTEST_INTERNAL_HAS_OPTIONAL)
    23092314#ifdef __has_include
    23102315#if __has_include(<optional>) && __cplusplus >= 201703L
     
    23122317// specializations.
    23132318#define GTEST_INTERNAL_HAS_OPTIONAL 1
     2319#endif  // __has_include(<optional>) && __cplusplus >= 201703L
     2320#endif  // __has_include
     2321#endif  // !defined(GTEST_INTERNAL_HAS_OPTIONAL)
     2322#if GTEST_INTERNAL_HAS_OPTIONAL
    23142323#include <optional>
    23152324namespace testing {
     
    23212330// The case where absl is configured NOT to alias std::optional is not
    23222331// supported.
    2323 #endif  // __has_include(<optional>) && __cplusplus >= 201703L
    2324 #endif  // __has_include
     2332#endif  // GTEST_INTERNAL_HAS_OPTIONAL
    23252333#endif  // GTEST_HAS_ABSL
    23262334
     
    23362344}  // namespace testing
    23372345#else
    2338 # ifdef __has_include
    2339 #   if __has_include(<string_view>) && __cplusplus >= 201703L
     2346#if !defined(GTEST_INTERNAL_HAS_STRING_VIEW)
     2347#ifdef __has_include
     2348#if __has_include(<string_view>) && __cplusplus >= 201703L
    23402349// Otherwise for C++17 and higher use std::string_view for Matcher<>
    23412350// specializations.
    2342 #   define GTEST_INTERNAL_HAS_STRING_VIEW 1
     2351#define GTEST_INTERNAL_HAS_STRING_VIEW 1
     2352#endif  // __has_include(<string_view>) && __cplusplus >= 201703L
     2353#endif  // __has_include
     2354#endif  // !defined(GTEST_INTERNAL_HAS_STRING_VIEW)
     2355#if GTEST_INTERNAL_HAS_STRING_VIEW
    23432356#include <string_view>
    23442357namespace testing {
     
    23492362// The case where absl is configured NOT to alias std::string_view is not
    23502363// supported.
    2351 #  endif  // __has_include(<string_view>) && __cplusplus >= 201703L
    2352 # endif  // __has_include
     2364#endif  // GTEST_INTERNAL_HAS_STRING_VIEW
    23532365#endif  // GTEST_HAS_ABSL
    23542366
     
    23652377}  // namespace testing
    23662378#else
     2379#if !defined(GTEST_INTERNAL_HAS_VARIANT)
    23672380#ifdef __has_include
    23682381#if __has_include(<variant>) && __cplusplus >= 201703L
     
    23702383// specializations.
    23712384#define GTEST_INTERNAL_HAS_VARIANT 1
     2385#endif  // __has_include(<variant>) && __cplusplus >= 201703L
     2386#endif  // __has_include
     2387#endif  // !defined(GTEST_INTERNAL_HAS_VARIANT)
     2388#if GTEST_INTERNAL_HAS_VARIANT
    23722389#include <variant>
    23732390namespace testing {
     
    23782395}  // namespace testing
    23792396// The case where absl is configured NOT to alias std::variant is not supported.
    2380 #endif  // __has_include(<variant>) && __cplusplus >= 201703L
    2381 #endif  // __has_include
     2397#endif  // GTEST_INTERNAL_HAS_VARIANT
    23822398#endif  // GTEST_HAS_ABSL
    23832399
Note: See TracChangeset for help on using the changeset viewer.