[cairo-commit] src/cairo-win32-surface.c

Andrea Canciani ranma42 at kemper.freedesktop.org
Fri Jan 21 00:58:19 PST 2011


 src/cairo-win32-surface.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 47d14586f5d56b2c926a2ddbca6cfbd284c3b3f1
Author: Mats Palmgren <matspal at gmail.com>
Date:   Fri Jan 21 09:52:19 2011 +0100

    win32: Improve error logging
    
    On win32 stderr is fully buffered, so fflush() should be called after
    each error to ensure it is printed to the console.
    
    There is no need to use fwprintf if the format string can be
    represented as char*.
    
    See https://bugs.freedesktop.org/show_bug.cgi?id=33319

diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c
index da8acca..4a36226 100644
--- a/src/cairo-win32-surface.c
+++ b/src/cairo-win32-surface.c
@@ -124,11 +124,13 @@ _cairo_win32_print_gdi_error (const char *context)
 			 0, NULL)) {
 	fprintf (stderr, "%s: Unknown GDI error", context);
     } else {
-	fwprintf (stderr, L"%s: %S", context, (wchar_t *)lpMsgBuf);
+	fprintf (stderr, "%s: %S", context, (wchar_t *)lpMsgBuf);
 
 	LocalFree (lpMsgBuf);
     }
 
+    fflush (stderr);
+
     /* We should switch off of last_status, but we'd either return
      * CAIRO_STATUS_NO_MEMORY or CAIRO_STATUS_UNKNOWN_ERROR and there
      * is no CAIRO_STATUS_UNKNOWN_ERROR.


More information about the cairo-commit mailing list