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>
This commit is contained in:
Peter Kasting 2024-08-21 19:39:56 -07:00 committed by Mark Mentovai
parent adb22c8169
commit 458bdec985
2 changed files with 5 additions and 19 deletions

View File

@ -730,7 +730,10 @@ if (!crashpad_is_android && !crashpad_is_ios) {
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") {

View File

@ -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 crashpad {
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;