[PATCH] D110309: [Sanitizer] Add #include to fix (some) Windows build

Stephan Bergmann via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 22 23:32:04 PDT 2021


sberg created this revision.
sberg added a reviewer: tejohnson.
sberg added a project: Sanitizers.
sberg requested review of this revision.
Herald added a subscriber: Sanitizers.

After 56dec4be9bd321a8fc0f19df00a8d63fc44813f5 <https://reviews.llvm.org/rG56dec4be9bd321a8fc0f19df00a8d63fc44813f5> "[Sanitizer] Allow setting the report path to create directory" introducing a call to _mkdir, at least my Windows build using VS 2022 Preview (17.0.0 Preview 4.1) started to fail with

  compiler-rt\lib\sanitizer_common\sanitizer_win.cpp(568): error C3861: '_mkdir': identifier not found

and https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/mkdir-wmkdir?view=msvc-160 "_mkdir, _wmkdir" says this requires <direct.h>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110309

Files:
  compiler-rt/lib/sanitizer_common/sanitizer_win.cpp


Index: compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
+++ compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
@@ -17,6 +17,7 @@
 #define WIN32_LEAN_AND_MEAN
 #define NOGDI
 #include <windows.h>
+#include <direct.h>
 #include <io.h>
 #include <psapi.h>
 #include <stdlib.h>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110309.374449.patch
Type: text/x-patch
Size: 399 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210923/d758d6ee/attachment.bin>


More information about the llvm-commits mailing list