From: Keith Whitwell Date: Fri, 17 Apr 2009 09:38:07 +0000 (+0100) Subject: util: flush stdout before emitting debug_printf on stderr X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29a2f6fead25b8231c27ec47cadb9265736d8527;p=mesa.git util: flush stdout before emitting debug_printf on stderr A lot of the mesa demos emit commentary on stdout, try to keep it in sync with the corresponding output from debug_printf(). --- diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index 96a2222f9b6..ae47a274a69 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -109,6 +109,7 @@ void _debug_vprintf(const char *format, va_list ap) } if(GetConsoleWindow() && !IsDebuggerPresent()) { + fflush(stdout); vfprintf(stderr, format, ap); fflush(stderr); } @@ -145,6 +146,7 @@ void _debug_vprintf(const char *format, va_list ap) /* TODO */ #else /* !PIPE_SUBSYSTEM_WINDOWS */ #ifdef DEBUG + fflush(stdout); vfprintf(stderr, format, ap); #endif #endif