summaryrefslogtreecommitdiffstats
path: root/googletest/test
diff options
context:
space:
mode:
authorDaniele Tamino <daniele.tamino@gmail.com>2016-02-20 03:06:12 (GMT)
committerDaniele Tamino <daniele.tamino@gmail.com>2016-02-22 22:07:12 (GMT)
commit9759dcda3c2f9c174521b9269018f79f55c29df8 (patch)
treec8c379b2e60c58f4adde26931bc9dc9d574edcb1 /googletest/test
parentff07a5de0e81580547f1685e101194ed1a4fcd56 (diff)
downloadgoogletest-9759dcda3c2f9c174521b9269018f79f55c29df8.zip
googletest-9759dcda3c2f9c174521b9269018f79f55c29df8.tar.gz
googletest-9759dcda3c2f9c174521b9269018f79f55c29df8.tar.bz2
Fix compilation on MinGW with native threads
Diffstat (limited to 'googletest/test')
-rw-r--r--googletest/test/gtest-port_test.cc7
-rw-r--r--googletest/test/gtest_unittest.cc2
2 files changed, 8 insertions, 1 deletions
diff --git a/googletest/test/gtest-port_test.cc b/googletest/test/gtest-port_test.cc
index 6ea607b..05f8821 100644
--- a/googletest/test/gtest-port_test.cc
+++ b/googletest/test/gtest-port_test.cc
@@ -1295,9 +1295,16 @@ TEST(WindowsTypesTest, HANDLEIsVoidStar) {
StaticAssertTypeEq<HANDLE, void*>();
}
+#if GTEST_OS_WINDOWS_MINGW
+TEST(WindowsTypesTest, _CRITICAL_SECTIONIs_CRITICAL_SECTION) {
+ StaticAssertTypeEq<CRITICAL_SECTION, _CRITICAL_SECTION>();
+}
+#else
TEST(WindowsTypesTest, CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION) {
StaticAssertTypeEq<CRITICAL_SECTION, _RTL_CRITICAL_SECTION>();
}
+#endif
+
#endif // GTEST_OS_WINDOWS
} // namespace internal
diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc
index 88e9413..97fcd5a 100644
--- a/googletest/test/gtest_unittest.cc
+++ b/googletest/test/gtest_unittest.cc
@@ -442,7 +442,7 @@ class FormatEpochTimeInMillisAsIso8601Test : public Test {
// tzset() distinguishes between the TZ variable being present and empty
// and not being present, so we have to consider the case of time_zone
// being NULL.
-#if _MSC_VER
+#if _MSC_VER || GTEST_OS_WINDOWS_MINGW
// ...Unless it's MSVC, whose standard library's _putenv doesn't
// distinguish between an empty and a missing variable.
const std::string env_var =