mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 02:12:11 +00:00
Corrected setStdIoUnbuffered for systems without stdout, stderr or stdin declared.
This commit is contained in:
@@ -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.}
|
||||
|
||||
Reference in New Issue
Block a user