summaryrefslogtreecommitdiffstats
path: root/googletest/test
diff options
context:
space:
mode:
authorBilly Donahue <BillyDonahue@users.noreply.github.com>2016-08-24 12:15:38 (GMT)
committerGitHub <noreply@github.com>2016-08-24 12:15:38 (GMT)
commited9d1e1ff92ce199de5ca2667a667cd0a368482a (patch)
tree456edae37d8b121f7a693b54665c0acadd688868 /googletest/test
parentec44c6c1675c25b9827aacd08c02433cccde7780 (diff)
parenta138385e48ee755ab8d124d6090c05580c8e9342 (diff)
downloadgoogletest-ed9d1e1ff92ce199de5ca2667a667cd0a368482a.zip
googletest-ed9d1e1ff92ce199de5ca2667a667cd0a368482a.tar.gz
googletest-ed9d1e1ff92ce199de5ca2667a667cd0a368482a.tar.bz2
Merge pull request #721 from ilmagico/fix-mingw-threads
Fix compilation of googletest with MinGW using Win32 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 =