summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2017-07-17 20:47:53 +0000
committerKamil Rytarowski <n54@gmx.com>2017-07-17 20:47:53 +0000
commitf36d180d7c9ab78ae0cb313fb612b266fe6c859e (patch)
tree892178d3105d5cc894fbd988e21bdd2f0afd9e59
parentc8095ce74118dee8544b0f1ffaba8f46aa10215c (diff)
downloadcompiler-rt-f36d180d7c9ab78ae0cb313fb612b266fe6c859e.tar.gz
Introduce SANITIZER_NETBSD in sanitizer_platform.h
Summary: Add defines for new NetBSD: SANITIZER_NETBSD, it will be used across the codebase for sanitizers. NetBSD is a POSIX-like platform, add it to SANITIZER_POSIX. Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, dim, alekseyshl, filcab, eugenis, vitalybuka Reviewed By: kcc Subscribers: kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D35467 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308216 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/sanitizer_common/sanitizer_platform.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/sanitizer_common/sanitizer_platform.h b/lib/sanitizer_common/sanitizer_platform.h
index 49732aa32..1df5fa34f 100644
--- a/lib/sanitizer_common/sanitizer_platform.h
+++ b/lib/sanitizer_common/sanitizer_platform.h
@@ -13,7 +13,7 @@
#ifndef SANITIZER_PLATFORM_H
#define SANITIZER_PLATFORM_H
-#if !defined(__linux__) && !defined(__FreeBSD__) && \
+#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) \
!defined(__APPLE__) && !defined(_WIN32)
# error "This operating system is not supported"
#endif
@@ -30,6 +30,12 @@
# define SANITIZER_FREEBSD 0
#endif
+#if defined(__NetBSD__)
+# define SANITIZER_NETBSD 1
+#else
+# define SANITIZER_NETBSD 0
+#endif
+
#if defined(__APPLE__)
# define SANITIZER_MAC 1
# include <TargetConditionals.h>
@@ -79,7 +85,8 @@
# define SANITIZER_ANDROID 0
#endif
-#define SANITIZER_POSIX (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC)
+#define SANITIZER_POSIX \
+ (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC || SANITIZER_NETBSD)
#if __LP64__ || defined(_WIN64)
# define SANITIZER_WORDSIZE 64