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.
This commit is contained in:
Vadim Zeitlin
2015-11-16 03:00:36 +01:00
parent 2eb5086260
commit 7c82b9a504

View File

@@ -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<size_t>(wParam),
static_cast<size_t>(lParam));
}
#endif // wxDEBUG_LEVEL >= 2