Fix strict Cygwin POSIX declarations

This commit is contained in:
ogredrool 2026-09-02 17:12:19 -06:00
parent efbef50b59
commit e883cb7717
3 changed files with 11 additions and 0 deletions

View File

@ -205,6 +205,10 @@ if (gtest_build_tests)
cxx_test(googletest-param-test-test gtest
test/googletest-param-test2-test.cc)
cxx_test(googletest-port-test gtest_main)
if (CYGWIN)
cxx_test(gtest_cygwin_strict_test gtest_main)
set_property(TARGET gtest_cygwin_strict_test PROPERTY CXX_EXTENSIONS OFF)
endif()
cxx_test(gtest_pred_impl_unittest gtest_main)
cxx_test(gtest_premature_exit_test gtest
test/gtest_premature_exit_test.cc)

View File

@ -272,6 +272,10 @@
// GCC15 warns that <ciso646> is deprecated in C++17 and suggests using
// <version> instead, even though <version> is not available in C++17 mode prior
// to GCC9.
#if defined(__CYGWIN__) && defined(__STRICT_ANSI__) && !defined(_POSIX_C_SOURCE)
#define _POSIX_C_SOURCE 200809L
#endif
#if GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L || \
GTEST_INTERNAL_HAS_INCLUDE(<version>)
#include <version> // C++20 or <version> support.

View File

@ -0,0 +1,3 @@
#include "gtest/gtest.h"
TEST(CygwinStrictStandardTest, PortHeaderCompiles) { SUCCEED(); }