Skip to content

Commit

Permalink
Fix _MSC_VER check
Browse files Browse the repository at this point in the history
Use "#if defined(_MSC_VER)" instead of "#if _MSC_VER" to be consistent
with other usages in googletest and to work with the "-Wundef" warning.

PiperOrigin-RevId: 508087630
Change-Id: I29c16fd2fa51a9dfecd55e10362a020318318956
  • Loading branch information
thughes authored and copybara-github committed Feb 8, 2023
1 parent 0570e2d commit b73f27f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion googletest/test/gtest_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,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 || GTEST_OS_WINDOWS_MINGW
#if defined(_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 =
Expand Down

0 comments on commit b73f27f

Please sign in to comment.