diff options
author | Troels Gram <28827711+to01z@users.noreply.github.com> | 2024-03-24 05:53:35 (GMT) |
---|---|---|
committer | Troels Gram <28827711+to01z@users.noreply.github.com> | 2024-03-24 05:53:35 (GMT) |
commit | f1269cc220734a5be8d68b370bf27efe6962bdb2 (patch) | |
tree | b4866013064e82dba9b2cadd44186508301dca1b /googletest/src | |
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/src')
-rw-r--r-- | googletest/src/gtest-port.cc | 4 | ||||
-rw-r--r-- | googletest/src/gtest.cc | 12 |
2 files changed, 9 insertions, 7 deletions
diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc index 3bb7dd4..d423814 100644 --- a/googletest/src/gtest-port.cc +++ b/googletest/src/gtest-port.cc @@ -1033,12 +1033,12 @@ GTestLog::~GTestLog() { } } +#if GTEST_HAS_STREAM_REDIRECTION + // Disable Microsoft deprecation warnings for POSIX functions called from // this class (creat, dup, dup2, and close) GTEST_DISABLE_MSC_DEPRECATED_PUSH_() -#if GTEST_HAS_STREAM_REDIRECTION - namespace { #if defined(GTEST_OS_LINUX_ANDROID) || defined(GTEST_OS_IOS) diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 36f4a2d..898904f 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -3184,8 +3184,9 @@ static void PrintTestPartResult(const TestPartResult& test_part_result) { } // class PrettyUnitTestResultPrinter -#if defined(GTEST_OS_WINDOWS) && !defined(GTEST_OS_WINDOWS_MOBILE) && \ - !defined(GTEST_OS_WINDOWS_PHONE) && !defined(GTEST_OS_WINDOWS_RT) && \ +#if defined(GTEST_OS_WINDOWS) && \ + !defined(GTEST_OS_WINDOWS_MOBILE) && !defined(GTEST_OS_WINDOWS_GAMES) && \ + !defined(GTEST_OS_WINDOWS_PHONE) && !defined(GTEST_OS_WINDOWS_RT) && \ !defined(GTEST_OS_WINDOWS_MINGW) // Returns the character attribute for the given color. @@ -3313,8 +3314,9 @@ static void ColoredPrintf(GTestColor color, const char* fmt, ...) { return; } -#if defined(GTEST_OS_WINDOWS) && !defined(GTEST_OS_WINDOWS_MOBILE) && \ - !defined(GTEST_OS_WINDOWS_PHONE) && !defined(GTEST_OS_WINDOWS_RT) && \ +#if defined(GTEST_OS_WINDOWS) && \ + !defined(GTEST_OS_WINDOWS_MOBILE) && !defined(GTEST_OS_WINDOWS_GAMES) && \ + !defined(GTEST_OS_WINDOWS_PHONE) && !defined(GTEST_OS_WINDOWS_RT) && \ !defined(GTEST_OS_WINDOWS_MINGW) const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE); @@ -5473,7 +5475,7 @@ int UnitTest::Run() { // about crashes - they are expected. if (impl()->catch_exceptions() || in_death_test_child_process) { #if !defined(GTEST_OS_WINDOWS_MOBILE) && !defined(GTEST_OS_WINDOWS_PHONE) && \ - !defined(GTEST_OS_WINDOWS_RT) + !defined(GTEST_OS_WINDOWS_RT) && !defined(GTEST_OS_WINDOWS_GAMES) // SetErrorMode doesn't exist on CE. SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX); |