Fix detection of the no_sanitize("hwaddress") attribute
PiperOrigin-RevId: 481765573 Change-Id: I1ba829c3cbf364a51d3ba383ee3b474c0e109578
This commit is contained in:
parent
6d71d901e1
commit
26d3ab5442
@ -658,6 +658,16 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
|
|||||||
#define GTEST_HAVE_ATTRIBUTE_(x) 0
|
#define GTEST_HAVE_ATTRIBUTE_(x) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// GTEST_HAVE_FEATURE_
|
||||||
|
//
|
||||||
|
// A function-like feature checking macro that is a wrapper around
|
||||||
|
// `__has_feature`.
|
||||||
|
#ifdef __has_feature
|
||||||
|
#define GTEST_HAVE_FEATURE_(x) __has_feature(x)
|
||||||
|
#else
|
||||||
|
#define GTEST_HAVE_FEATURE_(x) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
// Use this annotation at the end of a struct/class definition to
|
// Use this annotation at the end of a struct/class definition to
|
||||||
// prevent the compiler from optimizing away instances that are never
|
// prevent the compiler from optimizing away instances that are never
|
||||||
// used. This is useful when all interesting logic happens inside the
|
// used. This is useful when all interesting logic happens inside the
|
||||||
@ -812,7 +822,8 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// A function level attribute to disable HWAddressSanitizer instrumentation.
|
// A function level attribute to disable HWAddressSanitizer instrumentation.
|
||||||
#if GTEST_HAVE_ATTRIBUTE_(no_sanitize)
|
#if GTEST_HAVE_FEATURE_(hwaddress_sanitizer) && \
|
||||||
|
GTEST_HAVE_ATTRIBUTE_(no_sanitize)
|
||||||
#define GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_ \
|
#define GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_ \
|
||||||
__attribute__((no_sanitize("hwaddress")))
|
__attribute__((no_sanitize("hwaddress")))
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user