Don't redefine macros from base/compiler_specific.h.
`DISABLE_CFI_ICALL` is already defined in that header; use it.
This is both simpler and less likely to trigger macro redefinition
errors.
Bug: none
Change-Id: I3ecfe9b6dc4ac42c6a69b3fd9c6d2c68fe8e62a2
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5805458
Reviewed-by: Mark Mentovai <mark@chromium.org>
diff --git a/util/BUILD.gn b/util/BUILD.gn
index d4f4b2d..8d037fe 100644
--- a/util/BUILD.gn
+++ b/util/BUILD.gn
@@ -730,7 +730,10 @@
source_set("no_cfi_icall") {
sources = [ "misc/no_cfi_icall.h" ]
public_configs = [ "..:crashpad_config" ]
- public_deps = [ "$mini_chromium_source_parent:build" ]
+ public_deps = [
+ "$mini_chromium_source_parent:base",
+ "$mini_chromium_source_parent:build",
+ ]
}
source_set("util_test") {
diff --git a/util/misc/no_cfi_icall.h b/util/misc/no_cfi_icall.h
index bb3e594..7410026 100644
--- a/util/misc/no_cfi_icall.h
+++ b/util/misc/no_cfi_icall.h
@@ -18,6 +18,7 @@
#include <type_traits>
#include <utility>
+#include "base/compiler_specific.h"
#include "build/build_config.h"
#if BUILDFLAG(IS_WIN)
@@ -28,24 +29,6 @@
namespace {
-// Sanitizers annotations.
-#if defined(__has_attribute)
-#if __has_attribute(no_sanitize)
-#define NO_SANITIZE(what) __attribute__((no_sanitize(what)))
-#endif
-#endif
-#if !defined(NO_SANITIZE)
-#define NO_SANITIZE(what)
-#endif
-
-// DISABLE_CFI_ICALL -- Disable Control Flow Integrity indirect call checks.
-#if BUILDFLAG(IS_WIN)
-// Windows also needs __declspec(guard(nocf)).
-#define DISABLE_CFI_ICALL NO_SANITIZE("cfi-icall") __declspec(guard(nocf))
-#else
-#define DISABLE_CFI_ICALL NO_SANITIZE("cfi-icall")
-#endif
-
template <typename Functor>
struct FunctorTraits;