aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.mk2
-rw-r--r--util.h6
2 files changed, 7 insertions, 1 deletions
diff --git a/Android.mk b/Android.mk
index b027c42..7fec11f 100644
--- a/Android.mk
+++ b/Android.mk
@@ -205,6 +205,8 @@ LOCAL_MODULE := drop_privs
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS := $(minijailCommonCFlags)
LOCAL_CLANG := true
+# Don't build with ASan, but leave commented out for easy local debugging.
+# LOCAL_SANITIZE := address
LOCAL_SRC_FILES := \
examples/drop_privs.cpp
diff --git a/util.h b/util.h
index b4efc2f..15dd56b 100644
--- a/util.h
+++ b/util.h
@@ -38,7 +38,11 @@ static inline int is_android() {
}
static inline int running_with_asan() {
-#if defined(__clang__) && __has_feature(address_sanitizer)
+#ifndef __has_feature
+#define __has_feature(x) 0
+#endif
+
+#if __has_feature(address_sanitizer)
return 1;
#else
return 0;