diff options
| author | 2013-03-17 08:39:26 +0000 | |
|---|---|---|
| committer | 2013-03-17 08:39:26 +0000 | |
| commit | b3b3257747598d022b0fcda11473ded950f320e5 (patch) | |
| tree | 31fa8f5e69906548fcec1abee95de4fb304c5959 /src | |
| parent | 49dad77354324a0ea1093e40522158b5d5d221be (diff) | |
Windows OSD / stdout/stderr output buffering [qmc2]
Diffstat (limited to 'src')
| -rw-r--r-- | src/osd/windows/winmain.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/osd/windows/winmain.c b/src/osd/windows/winmain.c index 902290fa687..8fd2640ee9a 100644 --- a/src/osd/windows/winmain.c +++ b/src/osd/windows/winmain.c @@ -45,6 +45,7 @@ #include <commctrl.h> #include <mmsystem.h> #include <tchar.h> +#include <io.h> // standard C headers #include <ctype.h> @@ -454,6 +455,12 @@ const options_entry windows_options::s_option_entries[] = int main(int argc, char *argv[]) { + // use small output buffers on non-TTYs (i.e. pipes) + if (!isatty(fileno(stdout))) + setvbuf(stdout, (char *) NULL, _IOFBF, 64); + if (!isatty(fileno(stderr))) + setvbuf(stderr, (char *) NULL, _IOFBF, 64); + // initialize common controls InitCommonControls(); |
