Mercurial > molko
changeset 56:43d1102a367e
core: disable buffering on MinGW
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 21 Jan 2020 12:26:49 +0100 |
parents | 87b32293b95a |
children | 9f6267843815 |
files | src/sys.c |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/sys.c Mon Jan 20 13:38:05 2020 +0100 +++ b/src/sys.c Tue Jan 21 12:26:49 2020 +0100 @@ -17,6 +17,8 @@ */ #include <assert.h> +#include <stdio.h> +#include <stdlib.h> #include <SDL.h> #include <SDL_image.h> @@ -97,6 +99,11 @@ bool sys_init(void) { +#if defined(__MINGW64__) + /* On MinGW buffering leads to painful debugging. */ + setvbuf(stdout, NULL, _IONBF, 0); +#endif + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) return error_sdl(); if (IMG_Init(IMG_INIT_PNG) != IMG_INIT_PNG)