From 7c82b9a504437ca8593479c84040346163227155 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 16 Nov 2015 03:00:36 +0100 Subject: [PATCH] Really fix MSW message logging with wxDEBUG_LEVEL>=2 Now the code not only compiles, but also actually works, unlike before when %p was used with non-pointer types. Closes #17095. --- src/msw/window.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 6c5ff9ea91..4d5e1c704b 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -238,9 +238,14 @@ const wxChar *wxGetMessageName(int message); inline void wxTraceMSWMessage(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { + // The casts to size_t allow to avoid having different code for Win32 and + // Win64 as size_t is of the right size in both cases, unlike int or long. wxLogTrace("winmsg", - wxT("Processing %s(hWnd=%p, wParam=%p, lParam=%p)"), - wxGetMessageName(message), hWnd, wParam, lParam); + wxT("Processing %s(hWnd=%p, wParam=%zx, lParam=%zx)"), + wxGetMessageName(message), + hWnd, + static_cast(wParam), + static_cast(lParam)); } #endif // wxDEBUG_LEVEL >= 2