Disable stdout/stderr buffering on Windows
In MSYS2 on Windows, the output is buffered by default. Disable buffering to print output immediately. Note that in cmd.exe, it still prints nothing.
This commit is contained in:
parent
e8510a8cc3
commit
e69f6f710d
1 changed files with 6 additions and 0 deletions
|
@ -233,6 +233,12 @@ static SDL_bool parse_args(struct args *args, int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
#ifdef __WINDOWS__
|
||||||
|
// disable buffering, we want logs immediately
|
||||||
|
// even line buffering (setvbuf() with mode _IOLBF) is not sufficient
|
||||||
|
setbuf(stdout, NULL);
|
||||||
|
setbuf(stderr, NULL);
|
||||||
|
#endif
|
||||||
struct args args = {
|
struct args args = {
|
||||||
.serial = NULL,
|
.serial = NULL,
|
||||||
.help = SDL_FALSE,
|
.help = SDL_FALSE,
|
||||||
|
|
Loading…
Reference in a new issue