From c7f7666d9dfaef70828c5a71eacf68fc076918f2 Mon Sep 17 00:00:00 2001 From: Christian Blichmann Date: Mon, 8 Jul 2019 08:24:53 -0700 Subject: [PATCH] Do not leak macro definitions in stack-trace.h Since we use glog, we need to still rely on gFlags for as long as Abseil logging is not yet released. To do this, we have the util/flag.h header in SAPI, faking the newer style API of Abseil's flags library. The rationale behind this is that glog includes/builds with gflags for command line flag parsing and having more than one flag parsing library active at the same time is asking for trouble. PiperOrigin-RevId: 256982667 Change-Id: I9c5406cb9ef4458daebfec0b0713f9bddbf5c3ad --- sandboxed_api/sandbox2/stack-trace.h | 4 ---- sandboxed_api/sandbox2/stack-trace_test.cc | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sandboxed_api/sandbox2/stack-trace.h b/sandboxed_api/sandbox2/stack-trace.h index d28a979..d6b8046 100644 --- a/sandboxed_api/sandbox2/stack-trace.h +++ b/sandboxed_api/sandbox2/stack-trace.h @@ -24,15 +24,11 @@ #include #include -#include "sandboxed_api/util/flag.h" #include "sandboxed_api/sandbox2/mounts.h" #include "sandboxed_api/sandbox2/policy.h" #include "sandboxed_api/sandbox2/regs.h" #include "sandboxed_api/sandbox2/unwind/unwind.pb.h" -// Exposed for testing only -ABSL_DECLARE_FLAG(bool, sandbox_libunwind_crash_handler); - namespace sandbox2 { // Maximum depth of analyzed call stack. diff --git a/sandboxed_api/sandbox2/stack-trace_test.cc b/sandboxed_api/sandbox2/stack-trace_test.cc index b36e842..4609bc6 100644 --- a/sandboxed_api/sandbox2/stack-trace_test.cc +++ b/sandboxed_api/sandbox2/stack-trace_test.cc @@ -36,6 +36,8 @@ #include "sandboxed_api/sandbox2/util/temp_file.h" #include "sandboxed_api/util/status_matchers.h" +ABSL_DECLARE_FLAG(bool, sandbox_libunwind_crash_handler); + using ::testing::Eq; using ::testing::HasSubstr; using ::testing::Not;