Corrected setStdIoUnbuffered for systems without stdout, stderr or stdin declared.
This commit is contained in:
parent
52b4e8f661
commit
5327cd0a84
1 changed files with 6 additions and 3 deletions
|
|
@ -355,8 +355,11 @@ proc writeFile(filename, content: string) =
|
|||
sysFatal(IOError, "cannot open: ", filename)
|
||||
|
||||
proc setStdIoUnbuffered() =
|
||||
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.}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue