[PATCH] D51914: [ASan] [Windows] Avoid including windows.h in asan_malloc_win.cc

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 25 12:53:30 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL343014: [ASan] [Windows] Avoid including windows.h in asan_malloc_win.cc (authored by mstorsjo, committed by ).
Herald added a subscriber: delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D51914?vs=164815&id=166975#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D51914

Files:
  compiler-rt/trunk/lib/asan/asan_malloc_win.cc


Index: compiler-rt/trunk/lib/asan/asan_malloc_win.cc
===================================================================
--- compiler-rt/trunk/lib/asan/asan_malloc_win.cc
+++ compiler-rt/trunk/lib/asan/asan_malloc_win.cc
@@ -14,8 +14,17 @@
 
 #include "sanitizer_common/sanitizer_platform.h"
 #if SANITIZER_WINDOWS
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+// Intentionally not including windows.h here, to avoid the risk of
+// pulling in conflicting declarations of these functions. (With mingw-w64,
+// there's a risk of windows.h pulling in stdint.h.)
+typedef int BOOL;
+typedef void *HANDLE;
+typedef const void *LPCVOID;
+typedef void *LPVOID;
+
+#define HEAP_ZERO_MEMORY           0x00000008
+#define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010
+
 
 #include "asan_allocator.h"
 #include "asan_interceptors.h"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51914.166975.patch
Type: text/x-patch
Size: 822 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180925/d0fc6368/attachment.bin>


More information about the llvm-commits mailing list