From 692c3b11ff3877de90b653536d13dafc4e879ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Mon, 21 Mar 2016 16:25:19 +0000 Subject: [PATCH] GDK W32: Print error code along with the error message Error codes can be easily looked up in an error code list and/or googled up. Error messages, while descriptive, often describe the wrong thing, and the messages themselves are not part of the documentation of a function, unlike error codes. It would be preferable to have the code, or both. https://bugzilla.gnome.org/show_bug.cgi?id=763913 --- gdk/win32/gdkmain-win32.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c index a8a765063a..b170612a71 100644 --- a/gdk/win32/gdkmain-win32.c +++ b/gdk/win32/gdkmain-win32.c @@ -134,10 +134,11 @@ _gdk_win32_windowing_init (void) void _gdk_win32_api_failed (const gchar *where, - const gchar *api) + const gchar *api) { - gchar *msg = g_win32_error_message (GetLastError ()); - g_warning ("%s: %s failed: %s", where, api, msg); + DWORD error_code = GetLastError (); + gchar *msg = g_win32_error_message (error_code); + g_warning ("%s: %s failed with code %lu: %s", where, api, error_code, msg); g_free (msg); }