Corrected setStdIoUnbuffered for systems without stdout, stderr or stdin declared.

This commit is contained in:
A. S. Budden 2016-06-13 16:37:50 +01:00
commit 5327cd0a84

View file

@ -355,8 +355,11 @@ proc writeFile(filename, content: string) =
sysFatal(IOError, "cannot open: ", filename) sysFatal(IOError, "cannot open: ", filename)
proc setStdIoUnbuffered() = proc setStdIoUnbuffered() =
discard setvbuf(stdout, nil, IONBF, 0) when declared(stdout):
discard setvbuf(stderr, nil, IONBF, 0) discard setvbuf(stdout, nil, IONBF, 0)
discard setvbuf(stdin, nil, IONBF, 0) when declared(stderr):
discard setvbuf(stderr, nil, IONBF, 0)
when declared(stdin):
discard setvbuf(stdin, nil, IONBF, 0)
{.pop.} {.pop.}