summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2017-08-04 22:27:01 +0000
committerKamil Rytarowski <n54@gmx.com>2017-08-04 22:27:01 +0000
commita9ea11a357a8408e758dbaf6f8b98c7e77846fec (patch)
tree3662981f9f54d01fdf9738054cea29253067aa89
parent62ccbaa636912dc96859f08dccbd849f3108200a (diff)
downloadcompiler-rt-a9ea11a357a8408e758dbaf6f8b98c7e77846fec.tar.gz
Add NetBSD support in interception.h
Summary: 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, filcab, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36323 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310140 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/interception/interception.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/interception/interception.h b/lib/interception/interception.h
index 2d280731e..9e65ffa8e 100644
--- a/lib/interception/interception.h
+++ b/lib/interception/interception.h
@@ -16,7 +16,7 @@
#define INTERCEPTION_H
#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__APPLE__) && \
- !defined(_WIN32) && !defined(__Fuchsia__)
+ !defined(__NetBSD__) && !defined(_WIN32) && !defined(__Fuchsia__)
# error "Interception doesn't work on this operating system."
#endif
@@ -129,7 +129,7 @@ const interpose_substitution substitution_##func_name[] \
extern "C" ret_type func(__VA_ARGS__);
# define DECLARE_WRAPPER_WINAPI(ret_type, func, ...) \
extern "C" __declspec(dllimport) ret_type __stdcall func(__VA_ARGS__);
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
# define WRAP(x) __interceptor_ ## x
# define WRAPPER_NAME(x) "__interceptor_" #x
# define INTERCEPTOR_ATTRIBUTE __attribute__((visibility("default")))
@@ -264,7 +264,7 @@ typedef unsigned long uptr; // NOLINT
#define INCLUDED_FROM_INTERCEPTION_LIB
-#if defined(__linux__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
# include "interception_linux.h"
# define INTERCEPT_FUNCTION(func) INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func)
# define INTERCEPT_FUNCTION_VER(func, symver) \