LPARAM is a 64 bit type in Win64 and doesn't match the size expected by "%l"
printf format specifier. Instead of showing it as a 32 bit number in 32 bit
build and 64 bit in 64 bits, just truncate it to the lower 32 bits in any case
for now, this should be enough for the diagnostic messages.
Closes #12242.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65010
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// trace all messages: useful for the debugging but noticeably slows down
// the code so don't do it by default
#if wxDEBUG_LEVEL >= 2
// trace all messages: useful for the debugging but noticeably slows down
// the code so don't do it by default
#if wxDEBUG_LEVEL >= 2
+ // notice that we cast wParam and lParam to long to avoid mismatch with
+ // format specifiers in 64 bit builds where they are both int64 quantities
+ //
+ // casting like this loses information, of course, but it shouldn't matter
+ // much for this diagnostic code and it keeps the code simple
wxLogTrace("winmsg",
wxT("Processing %s(hWnd=%p, wParam=%08lx, lParam=%08lx)"),
wxLogTrace("winmsg",
wxT("Processing %s(hWnd=%p, wParam=%08lx, lParam=%08lx)"),
- wxGetMessageName(message), hWnd, (long)wParam, lParam);
+ wxGetMessageName(message), hWnd, (long)wParam, (long)lParam);
#endif // wxDEBUG_LEVEL >= 2
wxWindowMSW *wnd = wxFindWinFromHandle(hWnd);
#endif // wxDEBUG_LEVEL >= 2
wxWindowMSW *wnd = wxFindWinFromHandle(hWnd);