mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-07 13:33:22 +00:00
Fix compiler stuck on waiting C/CPP backends. (#7472)
This commit is contained in:
committed by
Andreas Rumpf
parent
755570bcfb
commit
0b99e8e8cb
@@ -494,7 +494,7 @@ when defined(Windows) and not defined(useNimRtl):
|
||||
sa.nLength = sizeof(SECURITY_ATTRIBUTES).cint
|
||||
sa.lpSecurityDescriptor = nil
|
||||
sa.bInheritHandle = 1
|
||||
if createPipe(rdHandle, wrHandle, sa, 1024) == 0'i32:
|
||||
if createPipe(rdHandle, wrHandle, sa, 0) == 0'i32:
|
||||
raiseOSError(osLastError())
|
||||
|
||||
proc fileClose(h: Handle) {.inline.} =
|
||||
@@ -524,6 +524,12 @@ when defined(Windows) and not defined(useNimRtl):
|
||||
he = ho
|
||||
else:
|
||||
createPipeHandles(he, si.hStdError)
|
||||
if setHandleInformation(he, DWORD(1), DWORD(0)) == 0'i32:
|
||||
raiseOsError(osLastError())
|
||||
if setHandleInformation(hi, DWORD(1), DWORD(0)) == 0'i32:
|
||||
raiseOsError(osLastError())
|
||||
if setHandleInformation(ho, DWORD(1), DWORD(0)) == 0'i32:
|
||||
raiseOsError(osLastError())
|
||||
else:
|
||||
createAllPipeHandles(si, hi, ho, he, cast[int](result))
|
||||
result.inHandle = FileHandle(hi)
|
||||
|
||||
@@ -704,6 +704,11 @@ proc duplicateHandle*(hSourceProcessHandle: HANDLE, hSourceHandle: HANDLE,
|
||||
dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,
|
||||
dwOptions: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",
|
||||
importc: "DuplicateHandle".}
|
||||
|
||||
proc setHandleInformation*(hObject: HANDLE, dwMask: DWORD,
|
||||
dwFlags: DWORD): WINBOOL {.stdcall,
|
||||
dynlib: "kernel32", importc: "SetHandleInformation".}
|
||||
|
||||
proc getCurrentProcess*(): HANDLE{.stdcall, dynlib: "kernel32",
|
||||
importc: "GetCurrentProcess".}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user