]> git-server-git.apps.pok.os.sepia.ceph.com Git - googletest.git/commitdiff
Fix _MSC_VER check
authorTom Hughes <tomhughes@google.com>
Wed, 4 Jan 2023 14:40:19 +0000 (06:40 -0800)
committerCopybara-Service <copybara-worker@google.com>
Wed, 4 Jan 2023 14:40:48 +0000 (06:40 -0800)
Use "#if defined(_MSC_VER)" instead of "#if _MSC_VER" to be consistent with other usages in the file and to work with the "-Wundef" warning.

PiperOrigin-RevId: 499471290
Change-Id: I34a9442eecf266afd74d4332cab7d39766df4ed9

googletest/include/gtest/internal/gtest-port.h

index 01bfd1f13ca0872e9c9fc5813ac3ca361aad4707..d427f71204ad16f1a4059e6fb3324c23fca0c8fd 100644 (file)
@@ -2142,7 +2142,7 @@ GTEST_DISABLE_MSC_DEPRECATED_POP_()
 // MSVC-based platforms.  We map the GTEST_SNPRINTF_ macro to the appropriate
 // function in order to achieve that.  We use macro definition here because
 // snprintf is a variadic function.
-#if _MSC_VER && !GTEST_OS_WINDOWS_MOBILE
+#if defined(_MSC_VER) && !GTEST_OS_WINDOWS_MOBILE
 // MSVC 2005 and above support variadic macros.
 #define GTEST_SNPRINTF_(buffer, size, format, ...) \
   _snprintf_s(buffer, size, size, format, __VA_ARGS__)