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
This commit is contained in:
Mats Palmgren 2011-01-21 09:52:19 +01:00 committed by Andrea Canciani
parent 72a9d49a53
commit 47d14586f5

View file

@ -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.