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
parent 52b4e8f661
commit 5327cd0a84

View File

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