Skip to content

Commit 9ebb0ab

Browse files
cvspvrtru
authored andcommitted
[lldb] Allow building using Mingw-w64 on Windows. (#150398)
I wasn't able to build lldb using Mingw-w64 on Windows without changing these 3 lines. It seems like `std::atomic<bool>` wasn't being found without `#include <atomic>` and `ceil` was defaulting to `std::ceil` instead of `std::chrono::ceil`, but I'm not smart enough to know the root cause. I'm sure I'm not the first people to try and compile lldb (and clang and lld) with Mingw-w64 and I don't know if something is wrong with my Mingw-w64, but my changes shouldn't have any affect if they aren't needed. (cherry picked from commit 1a32bcb)
1 parent c198dc7 commit 9ebb0ab

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lldb/source/Host/windows/MainLoopWindows.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "llvm/Config/llvm-config.h"
1515
#include "llvm/Support/WindowsError.h"
1616
#include <algorithm>
17+
#include <atomic>
1718
#include <cassert>
1819
#include <ctime>
1920
#include <io.h>

lldb/source/Host/windows/PipeWindows.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ llvm::Expected<size_t> PipeWindows::Read(void *buf, size_t size,
279279
return Status(failure_error, eErrorTypeWin32).takeError();
280280

281281
DWORD timeout_msec =
282-
timeout ? ceil<std::chrono::milliseconds>(*timeout).count() : INFINITE;
282+
timeout ? std::chrono::ceil<std::chrono::milliseconds>(*timeout).count()
283+
: INFINITE;
283284
DWORD wait_result =
284285
::WaitForSingleObject(m_read_overlapped.hEvent, timeout_msec);
285286
if (wait_result != WAIT_OBJECT_0) {
@@ -324,7 +325,8 @@ llvm::Expected<size_t> PipeWindows::Write(const void *buf, size_t size,
324325
return Status(failure_error, eErrorTypeWin32).takeError();
325326

326327
DWORD timeout_msec =
327-
timeout ? ceil<std::chrono::milliseconds>(*timeout).count() : INFINITE;
328+
timeout ? std::chrono::ceil<std::chrono::milliseconds>(*timeout).count()
329+
: INFINITE;
328330
DWORD wait_result =
329331
::WaitForSingleObject(m_write_overlapped.hEvent, timeout_msec);
330332
if (wait_result != WAIT_OBJECT_0) {

0 commit comments

Comments
 (0)