summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-02-20 14:14:19 +0000
committerJosé Fonseca <[email protected]>2009-02-20 14:14:19 +0000
commit5b41e30f2692c3321f3562c020b9fceabca45bf5 (patch)
tree3175eceef9526e1b6c85d218c63cd9b3002764c7 /src/gallium/auxiliary/util
parenta5c2570dc5a94dae8e50e0f8cd714b928aed695c (diff)
util: Also output messages to stderr on windows.
When there is a console attached, and no debugger attached.
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_debug.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c
index 7f2a113dead..0ddda698849 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -50,6 +50,7 @@
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#endif
#include <windows.h>
+#include <stdio.h>
#else
@@ -106,6 +107,11 @@ void _debug_vprintf(const char *format, va_list ap)
OutputDebugStringA(buf);
buf[0] = '\0';
}
+
+ if(GetConsoleWindow() && !IsDebuggerPresent()) {
+ vfprintf(stderr, format, ap);
+ }
+
#elif defined(PIPE_SUBSYSTEM_WINDOWS_CE)
wchar_t *wide_format;
long wide_str_len;