diff options
author | Abseil Team <absl-team@google.com> | 2024-01-18 22:23:34 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-01-18 22:24:26 (GMT) |
commit | 96cd50c082d880a9aab6455dcc5817cfbf0ea45f (patch) | |
tree | 16772f913ca3c1292ee90bc7b5d0e980d789cb99 /googletest/include | |
parent | f6f920d2ba09f3951af59045cd31c42e95bf127a (diff) | |
download | googletest-96cd50c082d880a9aab6455dcc5817cfbf0ea45f.zip googletest-96cd50c082d880a9aab6455dcc5817cfbf0ea45f.tar.gz googletest-96cd50c082d880a9aab6455dcc5817cfbf0ea45f.tar.bz2 |
If GTEST_NO_ABSL_FLAGS is #defined, then the Abseil flag library
will not be used by googletest, even if GTEST_HAS_ABSL is #defined.
PiperOrigin-RevId: 599625032
Change-Id: Ieb994a15683dec89e88578120071eca8ac9fead1
Diffstat (limited to 'googletest/include')
-rw-r--r-- | googletest/include/gtest/internal/gtest-port.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h index f2b591d..fa457b7 100644 --- a/googletest/include/gtest/internal/gtest-port.h +++ b/googletest/include/gtest/internal/gtest-port.h @@ -338,9 +338,10 @@ #define GTEST_HAS_NOTIFICATION_ 0 #endif -#ifdef GTEST_HAS_ABSL -#include "absl/flags/declare.h" +#if defined(GTEST_HAS_ABSL) && !defined(GTEST_NO_ABSL_FLAGS) +#define GTEST_INTERNAL_HAS_ABSL_FLAGS // Used only in this file. #include "absl/flags/flag.h" +#include "absl/flags/declare.h" #include "absl/flags/reflection.h" #endif @@ -2252,7 +2253,7 @@ using TimeInMillis = int64_t; // Represents time in milliseconds. #endif // !defined(GTEST_FLAG) // Pick a command line flags implementation. -#ifdef GTEST_HAS_ABSL +#ifdef GTEST_INTERNAL_HAS_ABSL_FLAGS // Macros for defining flags. #define GTEST_DEFINE_bool_(name, default_val, doc) \ @@ -2277,7 +2278,8 @@ using TimeInMillis = int64_t; // Represents time in milliseconds. (void)(::absl::SetFlag(>EST_FLAG(name), value)) #define GTEST_USE_OWN_FLAGFILE_FLAG_ 0 -#else // GTEST_HAS_ABSL +#undef GTEST_INTERNAL_HAS_ABSL_FLAGS +#else // ndef GTEST_INTERNAL_HAS_ABSL_FLAGS // Macros for defining flags. #define GTEST_DEFINE_bool_(name, default_val, doc) \ @@ -2319,7 +2321,7 @@ using TimeInMillis = int64_t; // Represents time in milliseconds. #define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value) #define GTEST_USE_OWN_FLAGFILE_FLAG_ 1 -#endif // GTEST_HAS_ABSL +#endif // GTEST_INTERNAL_HAS_ABSL_FLAGS // Thread annotations #if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_) |