aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2023-09-25 14:37:34 -0700
committerCopybara-Service <copybara-worker@google.com>2023-09-25 14:38:01 -0700
commite47544ad31cb3ceecd04cc13e8fe556f8df9fe0b (patch)
treed45c6849d99a6d5a4d999c732c966de1d4eddee4
parent5bd0f08e0dc2d879c40ada31a006c575c47cbc65 (diff)
downloadgoogletest-e47544ad31cb3ceecd04cc13e8fe556f8df9fe0b.tar.gz
Resolve `-Wundef` triggering on `GTEST_CREATE_SHARED_LIBRARY` and `GTEST_LINKED_AS_SHARED_LIBRARY` with shared libraries in GoogleTest
Fixes: #4372 PiperOrigin-RevId: 568327612 Change-Id: Ifc47f1a2a2648c29858a22966331557cc928cc47
-rw-r--r--googletest/include/gtest/internal/gtest-port.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h
index 5f741cad..d061a49b 100644
--- a/googletest/include/gtest/internal/gtest-port.h
+++ b/googletest/include/gtest/internal/gtest-port.h
@@ -845,9 +845,9 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
#ifndef GTEST_API_
#ifdef _MSC_VER
-#if GTEST_LINKED_AS_SHARED_LIBRARY
+#if defined(GTEST_LINKED_AS_SHARED_LIBRARY) && GTEST_LINKED_AS_SHARED_LIBRARY
#define GTEST_API_ __declspec(dllimport)
-#elif GTEST_CREATE_SHARED_LIBRARY
+#elif defined(GTEST_CREATE_SHARED_LIBRARY) && GTEST_CREATE_SHARED_LIBRARY
#define GTEST_API_ __declspec(dllexport)
#endif
#elif GTEST_HAVE_ATTRIBUTE_(visibility)