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