fixes the Windows build

This commit is contained in:
Andreas Rumpf 2017-10-16 19:52:22 +02:00
commit 527e20fd3a

View file

@ -406,6 +406,7 @@ proc setStdIoUnbuffered() =
when declared(stdout): when declared(stdout):
proc echoBinSafe(args: openArray[string]) {.compilerProc.} = proc echoBinSafe(args: openArray[string]) {.compilerProc.} =
when not defined(windows):
proc flockfile(f: File) {.importc, noDecl.} proc flockfile(f: File) {.importc, noDecl.}
proc funlockfile(f: File) {.importc, noDecl.} proc funlockfile(f: File) {.importc, noDecl.}
flockfile(stdout) flockfile(stdout)
@ -414,6 +415,7 @@ when declared(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)
when not defined(windows):
funlockfile(stdout) funlockfile(stdout)
{.pop.} {.pop.}