fixes the Windows build
This commit is contained in:
parent
098bf809b9
commit
527e20fd3a
1 changed files with 6 additions and 4 deletions
|
|
@ -406,14 +406,16 @@ proc setStdIoUnbuffered() =
|
||||||
|
|
||||||
when declared(stdout):
|
when declared(stdout):
|
||||||
proc echoBinSafe(args: openArray[string]) {.compilerProc.} =
|
proc echoBinSafe(args: openArray[string]) {.compilerProc.} =
|
||||||
proc flockfile(f: File) {.importc, noDecl.}
|
when not defined(windows):
|
||||||
proc funlockfile(f: File) {.importc, noDecl.}
|
proc flockfile(f: File) {.importc, noDecl.}
|
||||||
flockfile(stdout)
|
proc funlockfile(f: File) {.importc, noDecl.}
|
||||||
|
flockfile(stdout)
|
||||||
for s in args:
|
for s in args:
|
||||||
discard c_fwrite(s.cstring, s.len, 1, stdout)
|
discard c_fwrite(s.cstring, s.len, 1, stdout)
|
||||||
const linefeed = "\n" # can be 1 or more chars
|
const linefeed = "\n" # can be 1 or more chars
|
||||||
discard c_fwrite(linefeed.cstring, linefeed.len, 1, stdout)
|
discard c_fwrite(linefeed.cstring, linefeed.len, 1, stdout)
|
||||||
discard c_fflush(stdout)
|
discard c_fflush(stdout)
|
||||||
funlockfile(stdout)
|
when not defined(windows):
|
||||||
|
funlockfile(stdout)
|
||||||
|
|
||||||
{.pop.}
|
{.pop.}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue