summaryrefslogtreecommitdiff
path: root/lib/interception/interception_win.cc
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
commit230e72004d5e9365e3ce9676be84d496a3d2feb0 (patch)
tree4eb42ff3d0391907220d527fbeed47cb39c241e1 /lib/interception/interception_win.cc
parentc89976de25cd7700d24796f7f2fa9f20e51e4813 (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319906 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/interception/interception_win.cc')
-rw-r--r--lib/interception/interception_win.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/interception/interception_win.cc b/lib/interception/interception_win.cc
index ac0b0505e..dc3fe3524 100644
--- a/lib/interception/interception_win.cc
+++ b/lib/interception/interception_win.cc
@@ -125,9 +125,9 @@
// addr2: .bytes <body>
//===----------------------------------------------------------------------===//
-#ifdef _WIN32
-
#include "interception.h"
+
+#if SANITIZER_WINDOWS
#include "sanitizer_common/sanitizer_platform.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@@ -1013,4 +1013,4 @@ bool OverrideImportedFunction(const char *module_to_patch,
} // namespace __interception
-#endif // _WIN32
+#endif // SANITIZER_MAC