aboutsummaryrefslogtreecommitdiff
path: root/lib/sanitizer_common
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-10-20 15:35:01 +0000
committerDan Albert <danalbert@google.com>2014-10-20 08:46:40 -0700
commitb625a87696a619962e3b62804b0b42d8d6f31f29 (patch)
treeab2b0fd39b137d9f964319b96786d6c1c031ab96 /lib/sanitizer_common
parent89e94b2454e14439302ee68556e136b53f5ea2ca (diff)
downloadcompiler-rt-b625a87696a619962e3b62804b0b42d8d6f31f29.tar.gz
Fix checks for Android.
__ANDROID__ is a define that comes from the toolchain when building for Android targets. ANDROID has a different meaning. ANDROID is defined for _every_ Android build, including those done for host modules. For host modules, we want to build the regular Linux sanitizers and builtins, not the one for Android devices. This hasn't been a problem until now because we only just started building the sanitizers for the host. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220203 91177308-0d34-0410-b5e6-96231b3b80d8 (cherry picked from commit 75a00b772e5e035a420eb9639eba1dacf191f7d4)
Diffstat (limited to 'lib/sanitizer_common')
-rw-r--r--lib/sanitizer_common/sanitizer_platform.h2
-rw-r--r--lib/sanitizer_common/tests/sanitizer_test_utils.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/sanitizer_common/sanitizer_platform.h b/lib/sanitizer_common/sanitizer_platform.h
index d9a7868ef..a36959964 100644
--- a/lib/sanitizer_common/sanitizer_platform.h
+++ b/lib/sanitizer_common/sanitizer_platform.h
@@ -49,7 +49,7 @@
# define SANITIZER_WINDOWS 0
#endif
-#if defined(__ANDROID__) || defined(ANDROID)
+#if defined(__ANDROID__)
# define SANITIZER_ANDROID 1
#else
# define SANITIZER_ANDROID 0
diff --git a/lib/sanitizer_common/tests/sanitizer_test_utils.h b/lib/sanitizer_common/tests/sanitizer_test_utils.h
index db5d8faaa..64db37f34 100644
--- a/lib/sanitizer_common/tests/sanitizer_test_utils.h
+++ b/lib/sanitizer_common/tests/sanitizer_test_utils.h
@@ -95,13 +95,13 @@ static inline uint32_t my_rand() {
// Set availability of platform-specific functions.
-#if !defined(__APPLE__) && !defined(ANDROID) && !defined(__ANDROID__) && !defined(_WIN32)
+#if !defined(__APPLE__) && !defined(__ANDROID__) && !defined(_WIN32)
# define SANITIZER_TEST_HAS_POSIX_MEMALIGN 1
#else
# define SANITIZER_TEST_HAS_POSIX_MEMALIGN 0
#endif
-#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(ANDROID) && \
+#if !defined(__APPLE__) && !defined(__FreeBSD__) && \
!defined(__ANDROID__) && !defined(_WIN32)
# define SANITIZER_TEST_HAS_MEMALIGN 1
# define SANITIZER_TEST_HAS_PVALLOC 1