diff options
| author | Martin Storsjo <martin@martin.st> | 2018-09-25 19:50:36 +0000 |
|---|---|---|
| committer | Martin Storsjo <martin@martin.st> | 2018-09-25 19:50:36 +0000 |
| commit | 693f3a573c747d5d1d56164c7123dbb866977174 (patch) | |
| tree | f0328952451c654aee5c84d118a53a64e8ad9bca | |
| parent | fd9aa7e078a3b0ad486897dacba75b3c5207e352 (diff) | |
| download | bcm5719-llvm-693f3a573c747d5d1d56164c7123dbb866977174.tar.gz bcm5719-llvm-693f3a573c747d5d1d56164c7123dbb866977174.zip | |
[ASan] [Windows] Avoid including windows.h in asan_malloc_win.cc
Instead provide manual declarations of the used types, to avoid
pulling in conflicting declarations of some of the functions that
are to be overridden.
Differential Revision: https://reviews.llvm.org/D51914
llvm-svn: 343014
| -rw-r--r-- | compiler-rt/lib/asan/asan_malloc_win.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/compiler-rt/lib/asan/asan_malloc_win.cc b/compiler-rt/lib/asan/asan_malloc_win.cc index 04ba5300628..a094e051cc2 100644 --- a/compiler-rt/lib/asan/asan_malloc_win.cc +++ b/compiler-rt/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" |

