summaryrefslogtreecommitdiff
path: root/os-win32.c
diff options
context:
space:
mode:
authorStefan Weil <weil@mail.berlios.de>2010-10-07 18:55:48 +0200
committerBlue Swirl <blauwirbel@gmail.com>2010-10-09 08:20:39 +0000
commit6650b7100b58d9f81ae5117d03e89dc97f142897 (patch)
treeffbc77254bc13c7b12d0b3516340873fbae17dbc /os-win32.c
parentea95f15602234c1ff9c9be176ebe8bba55ee4dab (diff)
win32: Set unbuffered stdout
Win32 does not support line-buffering, but it allows unbuffered output. Unbuffered output is a good approximation. For typical output statements which usually end with '\n', it's even identical. Buffered output is unusable for program traces because of its large delay. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'os-win32.c')
-rw-r--r--os-win32.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/os-win32.c b/os-win32.c
index dd46bf459d..3c6f50fa94 100644
--- a/os-win32.c
+++ b/os-win32.c
@@ -221,6 +221,12 @@ char *os_find_datadir(const char *argv0)
return NULL;
}
+void os_set_line_buffering(void)
+{
+ setbuf(stdout, NULL);
+ setbuf(stderr, NULL);
+}
+
/*
* Parse OS specific command line options.
* return 0 if option handled, -1 otherwise