[Lldb-commits] [lldb] bb189b9 - [lldb] [Windows] Add a missing include. NFC. (#223727)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Sep 15 11:52:03 PDT 2026
Author: Martin Storsjö
Date: 2026-09-15T21:51:58+03:00
New Revision: bb189b9bea4469d7f950745fd8b8c65c5acf21c9
URL: https://github.com/llvm/llvm-project/commit/bb189b9bea4469d7f950745fd8b8c65c5acf21c9
DIFF: https://github.com/llvm/llvm-project/commit/bb189b9bea4469d7f950745fd8b8c65c5acf21c9.diff
LOG: [lldb] [Windows] Add a missing include. NFC. (#223727)
_open_osfhandle is defined in io.h, which wasn't explicitly included
before.
This built fine in practice with both WinSDK and recent mingw-w64
headers, but failed with older versions of mingw-w64 (older than August
2026).
Also change an accidental #if into #ifdef.
This fixes regressions from 1ca6698be7708121f987d0acf896c7dc4cf63a51 and
ba1687b72476eb368641b9a9f565a38cf41b7393.
Added:
Modified:
lldb/source/API/SBFile.cpp
Removed:
################################################################################
diff --git a/lldb/source/API/SBFile.cpp b/lldb/source/API/SBFile.cpp
index ab8e6e152d39e..1ec3e1e6df451 100644
--- a/lldb/source/API/SBFile.cpp
+++ b/lldb/source/API/SBFile.cpp
@@ -11,6 +11,10 @@
#include "lldb/Host/File.h"
#include "lldb/Utility/Instrumentation.h"
+#ifdef _WIN32
+#include <io.h>
+#endif
+
using namespace lldb;
using namespace lldb_private;
@@ -70,7 +74,7 @@ SBFile::SBFile(int fd, const char *mode, bool transfer_ownership) {
}
int SBFile::OpenFdFromHandle(intptr_t handle, int flags) {
-#if _WIN32
+#ifdef _WIN32
return _open_osfhandle(handle, flags);
#else
(void)handle;
More information about the lldb-commits
mailing list