diff options
author | Troels Gram <28827711+to01z@users.noreply.github.com> | 2024-03-23 22:53:35 -0700 |
---|---|---|
committer | Troels Gram <28827711+to01z@users.noreply.github.com> | 2024-03-23 22:53:35 -0700 |
commit | f1269cc220734a5be8d68b370bf27efe6962bdb2 (patch) | |
tree | b4866013064e82dba9b2cadd44186508301dca1b /googletest/include/gtest/internal | |
parent | eff443c6ef5eb6ab598bfaae27f9427fdb4f6af7 (diff) | |
download | googletest-f1269cc220734a5be8d68b370bf27efe6962bdb2.zip googletest-f1269cc220734a5be8d68b370bf27efe6962bdb2.tar.gz googletest-f1269cc220734a5be8d68b370bf27efe6962bdb2.tar.bz2 |
Add support for compiling GoogleTest for Xbox
Support for Xbox platforms, requires the code to support compilation with the
WINAPI_FAMILY_GAMES subset of the Win32 API.
- Add support for WINAPI_FAMILY_GAMES to enable GTEST_OS_WINDOWS_GAMES platform.
- Disable stream redirection (GTEST_HAS_STREAM_REDIRECTION = 0) and colored TTY
printing for GTEST_OS_WINDOWS_GAMES platform. Both features currently require
Win32 functions that don't exist in the WINAPI_FAMILY_GAMES subset.
Misc fixes:
- gtest-port.cc: Move GTEST_DISABLE_MSC_DEPRECATED_PUSH_ into
GTEST_HAS_STREAM_REDIRECTION conditional section where the corresponding
GTEST_DISABLE_MSC_DEPRECATED_POP_ is located.
- googletest-port-test.cc: Switch stream redirection tests to be conditional on
GTEST_HAS_STREAM_REDIRECTION instead of !defined(GTEST_OS_WINDOWS_MOBILE).
Diffstat (limited to 'googletest/include/gtest/internal')
-rw-r--r-- | googletest/include/gtest/internal/gtest-port-arch.h | 2 | ||||
-rw-r--r-- | googletest/include/gtest/internal/gtest-port.h | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/googletest/include/gtest/internal/gtest-port-arch.h b/googletest/include/gtest/internal/gtest-port-arch.h index 3162f2b..7ec968f 100644 --- a/googletest/include/gtest/internal/gtest-port-arch.h +++ b/googletest/include/gtest/internal/gtest-port-arch.h @@ -56,6 +56,8 @@ #elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TV_TITLE) #define GTEST_OS_WINDOWS_PHONE 1 #define GTEST_OS_WINDOWS_TV_TITLE 1 +#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_GAMES) +#define GTEST_OS_WINDOWS_GAMES 1 #else // WINAPI_FAMILY defined but no known partition matched. // Default to desktop. diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h index fa457b7..35bcf9b 100644 --- a/googletest/include/gtest/internal/gtest-port.h +++ b/googletest/include/gtest/internal/gtest-port.h @@ -658,9 +658,10 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; // By default, we assume that stream redirection is supported on all // platforms except known mobile / embedded ones. Also, if the port doesn't have // a file system, stream redirection is not supported. -#if defined(GTEST_OS_WINDOWS_MOBILE) || defined(GTEST_OS_WINDOWS_PHONE) || \ - defined(GTEST_OS_WINDOWS_RT) || defined(GTEST_OS_ESP8266) || \ - defined(GTEST_OS_XTENSA) || defined(GTEST_OS_QURT) || \ +#if defined(GTEST_OS_WINDOWS_MOBILE) || defined(GTEST_OS_WINDOWS_PHONE) || \ + defined(GTEST_OS_WINDOWS_RT) || defined(GTEST_OS_WINDOWS_GAMES) || \ + defined(GTEST_OS_ESP8266) || \ + defined(GTEST_OS_XTENSA) || defined(GTEST_OS_QURT) || \ !GTEST_HAS_FILE_SYSTEM #define GTEST_HAS_STREAM_REDIRECTION 0 #else @@ -2108,7 +2109,8 @@ GTEST_DISABLE_MSC_DEPRECATED_PUSH_() // defined there. #if GTEST_HAS_FILE_SYSTEM #if !defined(GTEST_OS_WINDOWS_MOBILE) && !defined(GTEST_OS_WINDOWS_PHONE) && \ - !defined(GTEST_OS_WINDOWS_RT) && !defined(GTEST_OS_ESP8266) && \ + !defined(GTEST_OS_WINDOWS_RT) && !defined(GTEST_OS_WINDOWS_GAMES) && \ + !defined(GTEST_OS_ESP8266) && \ !defined(GTEST_OS_XTENSA) && !defined(GTEST_OS_QURT) inline int ChDir(const char* dir) { return chdir(dir); } #endif |