mesa: Output warnings to debugger on Windows.
authorJosé Fonseca <jfonseca@vmware.com>
Sat, 30 May 2009 19:42:55 +0000 (12:42 -0700)
committerJosé Fonseca <jfonseca@vmware.com>
Sun, 31 May 2009 03:29:02 +0000 (20:29 -0700)
Stderr of Windows applications without console is not usually
visible.

src/mesa/main/imports.c

index 615f7c9..3fb6708 100644 (file)
@@ -1008,6 +1008,16 @@ output_if_debug(const char *prefixString, const char *outputString,
       fprintf(stderr, "%s: %s", prefixString, outputString);
       if (newline)
          fprintf(stderr, "\n");
+
+#if defined(_WIN32) && !defined(_WIN32_WCE)
+      /* stderr from windows applications without console is not usually 
+       * visible, so communicate with the debugger instead */ 
+      {
+         char buf[4096];
+         _mesa_snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : "");
+         OutputDebugStringA(buf);
+      }
+#endif
    }
 }