[compiler-rt] r343013 - [Sanitizers] [MinGW] Check for __i386__ in addition to _M_IX86 for i386 specific details

Martin Storsjo via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 25 12:50:32 PDT 2018


Author: mstorsjo
Date: Tue Sep 25 12:50:32 2018
New Revision: 343013

URL: http://llvm.org/viewvc/llvm-project?rev=343013&view=rev
Log:
[Sanitizers] [MinGW] Check for __i386__ in addition to _M_IX86 for i386 specific details

The MinGW headers do define _M_IX86 (contrary to clang-cl and
MSVC where it is a compiler predefined macro), but the headers that
define it aren't included here.

Also check these defines for setting the symbol prefix, instead of
inconsistently using _WIN64 for that.

Differential Revision: https://reviews.llvm.org/D51883

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_win_defs.h

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_win_defs.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_win_defs.h?rev=343013&r1=343012&r2=343013&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_win_defs.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_win_defs.h Tue Sep 25 12:50:32 2018
@@ -17,17 +17,17 @@
 #if SANITIZER_WINDOWS
 
 #ifndef WINAPI
-#ifdef _M_IX86
+#if defined(_M_IX86) || defined(__i386__)
 #define WINAPI __stdcall
 #else
 #define WINAPI
 #endif
 #endif
 
-#if defined(_WIN64)
-#define WIN_SYM_PREFIX
-#else
+#if defined(_M_IX86) || defined(__i386__)
 #define WIN_SYM_PREFIX "_"
+#else
+#define WIN_SYM_PREFIX
 #endif
 
 // Intermediate macro to ensure the parameter is expanded before stringified.




More information about the llvm-commits mailing list