summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_common.h
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2019-03-01 22:30:14 +0000
committerMartin Storsjo <martin@martin.st>2019-03-01 22:30:14 +0000
commit05394af3ffd91ceceabb5e28e47ab0976471b8df (patch)
tree33509d639d3cd953030838dba0571edae3f5705a /compiler-rt/lib/sanitizer_common/sanitizer_common.h
parentd8632c92a718acf4def33035c9260384c1726824 (diff)
downloadbcm5719-llvm-05394af3ffd91ceceabb5e28e47ab0976471b8df.tar.gz
bcm5719-llvm-05394af3ffd91ceceabb5e28e47ab0976471b8df.zip
[sanitizers] Don't use Windows Trace Logging on MinGW
mingw-w64 currently is lacking the headers for this feature. Make the include lowercase at the same time. We consistently use lowercase for windows header includes, as windows itself is case insensitive, the SDK headers (in general, not necessarily considering this particular header) aren't consistent among themselves about what the proper canonical capitalization for headers are, and MinGW uses all lowercase names for the headers (as it is often used on case sensitive filesystems). In case mingw-w64 later gets this header, we can revert this (but keep the include lowercased). Differential Revision: https://reviews.llvm.org/D58765 llvm-svn: 355236
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_common.h')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_common.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.h b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
index d0e982fba92..fa7a1987106 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
@@ -804,7 +804,13 @@ enum AndroidApiLevel {
void WriteToSyslog(const char *buffer);
-#if SANITIZER_MAC || SANITIZER_WINDOWS
+#if defined(SANITIZER_WINDOWS) && defined(_MSC_VER)
+#define SANITIZER_WIN_TRACE 1
+#else
+#define SANITIZER_WIN_TRACE 0
+#endif
+
+#if SANITIZER_LINUX || SANITIZER_WIN_TRACE
void LogFullErrorReport(const char *buffer);
#else
INLINE void LogFullErrorReport(const char *buffer) {}
@@ -818,7 +824,7 @@ INLINE void WriteOneLineToSyslog(const char *s) {}
INLINE void LogMessageOnPrintf(const char *str) {}
#endif
-#if SANITIZER_LINUX || SANITIZER_WINDOWS
+#if SANITIZER_LINUX || SANITIZER_WIN_TRACE
// Initialize Android logging. Any writes before this are silently lost.
void AndroidLogInit();
void SetAbortMessage(const char *);
OpenPOWER on IntegriCloud