summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/interception/interception_linux.h
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2017-12-06 17:02:00 +0000
committerKamil Rytarowski <n54@gmx.com>2017-12-06 17:02:00 +0000
commit90b46353e7a63a42f0a4d7ce0fcbe4ae8ad3226b (patch)
tree6da3d781a90f87f0033ffcd335f49ddd425471a5 /compiler-rt/lib/interception/interception_linux.h
parenta74ff71a376882405873dd29e5a90f5da58e614c (diff)
downloadbcm5719-llvm-90b46353e7a63a42f0a4d7ce0fcbe4ae8ad3226b.tar.gz
bcm5719-llvm-90b46353e7a63a42f0a4d7ce0fcbe4ae8ad3226b.zip
[Sanitizers] Use SANITIZER_* macros in lib/interception
Summary: Unlike the rest of the sanitizer code, lib/interception uses native macros like __linux__ to check for specific targets instead of the common ones like SANITIZER_LINUX. When working on the Solaris port of the sanitizers, the current style was found to not only be inconsistent, but clumsy to use because the canonical way to check for Solaris is to check for __sun__ && __svr4__ which is a mouthful. Therefore, this patch switches to use SANITIZER_* macros instead. Tested on x86_64-pc-linux-gnu. Reviewers: kcc, vitalybuka Reviewed By: vitalybuka Subscribers: #sanitizers, srhines, krytarowski, llvm-commits, fedor.sergeev Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D39798 llvm-svn: 319906
Diffstat (limited to 'compiler-rt/lib/interception/interception_linux.h')
-rw-r--r--compiler-rt/lib/interception/interception_linux.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler-rt/lib/interception/interception_linux.h b/compiler-rt/lib/interception/interception_linux.h
index 0e15bd8e1b4..5fcc4ff819f 100644
--- a/compiler-rt/lib/interception/interception_linux.h
+++ b/compiler-rt/lib/interception/interception_linux.h
@@ -12,7 +12,7 @@
// Linux-specific interception methods.
//===----------------------------------------------------------------------===//
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
+#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
#if !defined(INCLUDED_FROM_INTERCEPTION_LIB)
# error "interception_linux.h should be included from interception library only"
@@ -34,14 +34,14 @@ void *GetFuncAddrVer(const char *func_name, const char *ver);
(::__interception::uptr) & (func), \
(::__interception::uptr) & WRAP(func))
-#if !defined(__ANDROID__) // android does not have dlvsym
+#if !SANITIZER_ANDROID // android does not have dlvsym
#define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \
(::__interception::real_##func = (func##_f)( \
unsigned long)::__interception::GetFuncAddrVer(#func, symver))
#else
#define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \
INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func)
-#endif // !defined(__ANDROID__)
+#endif // !SANITIZER_ANDROID
#endif // INTERCEPTION_LINUX_H
-#endif // __linux__ || __FreeBSD__ || __NetBSD__
+#endif // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
OpenPOWER on IntegriCloud