From ef26c969cb7594cf8d01b237eb3466780201d2dc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 27 May 2018 23:25:15 +0200 Subject: [PATCH] Use correct DLGPROC callback signature in Win64 build The callback used with CreateDialogIndirect() must return INT_PTR, which is 64 bits under Win64, not LONG, which is still 32 bits. This fixes a gcc8 -Wcast-function-type warning and might fix a real bug in Win64 build too. --- src/msw/nativdlg.cpp | 2 +- src/msw/toplevel.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/msw/nativdlg.cpp b/src/msw/nativdlg.cpp index d11a4dd2b9..cdd058fe5f 100644 --- a/src/msw/nativdlg.cpp +++ b/src/msw/nativdlg.cpp @@ -36,7 +36,7 @@ // global functions // --------------------------------------------------------------------------- -extern LONG APIENTRY +extern INT_PTR APIENTRY wxDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); // =========================================================================== diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 1d525d50f1..2d24bf92a5 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -51,7 +51,7 @@ // NB: wxDlgProc must be defined here and not in dialog.cpp because the latter // is not included by wxUniv build which does need wxDlgProc -LONG APIENTRY +INT_PTR APIENTRY wxDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); // ---------------------------------------------------------------------------- @@ -1242,7 +1242,7 @@ void wxTopLevelWindowMSW::OnActivate(wxActivateEvent& event) } // the DialogProc for all wxWidgets dialogs -LONG APIENTRY +INT_PTR APIENTRY wxDlgProc(HWND WXUNUSED(hDlg), UINT message, WPARAM WXUNUSED(wParam),