summaryrefslogtreecommitdiffstats
path: root/googletest/src
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@google.com>2023-03-04 00:03:22 (GMT)
committerCopybara-Service <copybara-worker@google.com>2023-03-06 15:16:32 (GMT)
commit16feffa8fa7cb6e061787ce345c16eb24326d2ce (patch)
tree96b4e5fce8cb287148427aa308c907e7c381edf6 /googletest/src
parentdc10c3b5e55c1101e7759bdb7bf9790cebbf4ad2 (diff)
downloadgoogletest-16feffa8fa7cb6e061787ce345c16eb24326d2ce.zip
googletest-16feffa8fa7cb6e061787ce345c16eb24326d2ce.tar.gz
googletest-16feffa8fa7cb6e061787ce345c16eb24326d2ce.tar.bz2
Replace "#if GTEST_HAS_ABSL" with "#ifdef GTEST_HAS_ABSL"
This allows compilation with "-Wundef" (#3267). PiperOrigin-RevId: 513945230 Change-Id: I45ef19c7ff3d20e97216bd031d406a03365471da
Diffstat (limited to 'googletest/src')
-rw-r--r--googletest/src/gtest-internal-inl.h2
-rw-r--r--googletest/src/gtest.cc12
2 files changed, 7 insertions, 7 deletions
diff --git a/googletest/src/gtest-internal-inl.h b/googletest/src/gtest-internal-inl.h
index 007e049..16841b5 100644
--- a/googletest/src/gtest-internal-inl.h
+++ b/googletest/src/gtest-internal-inl.h
@@ -442,7 +442,7 @@ class OsStackTraceGetter : public OsStackTraceGetterInterface {
void UponLeavingGTest() override;
private:
-#if GTEST_HAS_ABSL
+#ifdef GTEST_HAS_ABSL
Mutex mutex_; // Protects all internal state.
// We save the stack frame below the frame that calls user code.
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index 7ffbf41..0dd3eba 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -135,7 +135,7 @@
#endif
#endif
-#if GTEST_HAS_ABSL
+#ifdef GTEST_HAS_ABSL
#include "absl/debugging/failure_signal_handler.h"
#include "absl/debugging/stacktrace.h"
#include "absl/debugging/symbolize.h"
@@ -4958,7 +4958,7 @@ const char* const OsStackTraceGetterInterface::kElidedFramesMarker =
std::string OsStackTraceGetter::CurrentStackTrace(int max_depth, int skip_count)
GTEST_LOCK_EXCLUDED_(mutex_) {
-#if GTEST_HAS_ABSL
+#ifdef GTEST_HAS_ABSL
std::string result;
if (max_depth <= 0) {
@@ -5007,7 +5007,7 @@ std::string OsStackTraceGetter::CurrentStackTrace(int max_depth, int skip_count)
}
void OsStackTraceGetter::UponLeavingGTest() GTEST_LOCK_EXCLUDED_(mutex_) {
-#if GTEST_HAS_ABSL
+#ifdef GTEST_HAS_ABSL
void* caller_frame = nullptr;
if (absl::GetStackTrace(&caller_frame, 1, 3) <= 0) {
caller_frame = nullptr;
@@ -5686,7 +5686,7 @@ void UnitTestImpl::PostFlagParsingInit() {
ConfigureStreamingOutput();
#endif // GTEST_CAN_STREAM_RESULTS_
-#if GTEST_HAS_ABSL
+#ifdef GTEST_HAS_ABSL
if (GTEST_FLAG_GET(install_failure_signal_handler)) {
absl::FailureSignalHandlerOptions options;
absl::InstallFailureSignalHandler(options);
@@ -6668,7 +6668,7 @@ void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
// Parses the command line for Google Test flags, without initializing
// other parts of Google Test.
void ParseGoogleTestFlagsOnly(int* argc, char** argv) {
-#if GTEST_HAS_ABSL
+#ifdef GTEST_HAS_ABSL
if (*argc > 0) {
// absl::ParseCommandLine() requires *argc > 0.
auto positional_args = absl::flags_internal::ParseCommandLineImpl(
@@ -6720,7 +6720,7 @@ void InitGoogleTestImpl(int* argc, CharType** argv) {
g_argvs.push_back(StreamableToString(argv[i]));
}
-#if GTEST_HAS_ABSL
+#ifdef GTEST_HAS_ABSL
absl::InitializeSymbolizer(g_argvs[0].c_str());
// When using the Abseil Flags library, set the program usage message to the