daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
b8c242
From 01da36fadd365329cfd9e2c97eb419c63404b25f Mon Sep 17 00:00:00 2001
b8c242
From: Lennart Poettering <lennart@poettering.net>
b8c242
Date: Mon, 3 Dec 2018 17:30:19 +0100
b8c242
Subject: [PATCH] macro: define HAS_FEATURE_ADDRESS_SANITIZER also on gcc
b8c242
b8c242
Let's make differences between compilers more minimal.
b8c242
b8c242
(cherry picked from commit be5f77b26e22a806179c7b03e03d424682ed325c)
b8c242
b8c242
Related: #2017033
b8c242
---
b8c242
 src/basic/macro.h | 4 +++-
b8c242
 1 file changed, 3 insertions(+), 1 deletion(-)
b8c242
b8c242
diff --git a/src/basic/macro.h b/src/basic/macro.h
b8c242
index 62f2359633..e87026882f 100644
b8c242
--- a/src/basic/macro.h
b8c242
+++ b/src/basic/macro.h
b8c242
@@ -56,7 +56,9 @@
b8c242
 #endif
b8c242
 
b8c242
 #if !defined(HAS_FEATURE_ADDRESS_SANITIZER)
b8c242
-#  if defined(__has_feature)
b8c242
+#  ifdef __SANITIZE_ADDRESS__
b8c242
+#      define HAS_FEATURE_ADDRESS_SANITIZER 1
b8c242
+#  elif defined(__has_feature)
b8c242
 #    if __has_feature(address_sanitizer)
b8c242
 #      define HAS_FEATURE_ADDRESS_SANITIZER 1
b8c242
 #    endif