Skip to content

Commit 27169a7

Browse files
committed
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 llvm-svn: 308216
1 parent 4556c9b commit 27169a7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_platform.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#ifndef SANITIZER_PLATFORM_H
1414
#define SANITIZER_PLATFORM_H
1515

16-
#if !defined(__linux__) && !defined(__FreeBSD__) && \
16+
#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) \
1717
!defined(__APPLE__) && !defined(_WIN32)
1818
# error "This operating system is not supported"
1919
#endif
@@ -30,6 +30,12 @@
3030
# define SANITIZER_FREEBSD 0
3131
#endif
3232

33+
#if defined(__NetBSD__)
34+
# define SANITIZER_NETBSD 1
35+
#else
36+
# define SANITIZER_NETBSD 0
37+
#endif
38+
3339
#if defined(__APPLE__)
3440
# define SANITIZER_MAC 1
3541
# include <TargetConditionals.h>
@@ -79,7 +85,8 @@
7985
# define SANITIZER_ANDROID 0
8086
#endif
8187

82-
#define SANITIZER_POSIX (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC)
88+
#define SANITIZER_POSIX \
89+
(SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC || SANITIZER_NETBSD)
8390

8491
#if __LP64__ || defined(_WIN64)
8592
# define SANITIZER_WORDSIZE 64

0 commit comments

Comments
 (0)