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