From 8bf9ec0cb4d4f15bbc2e0e6ccadb43284bcfaa7a Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Thu, 20 Mar 2014 11:40:58 +0100 Subject: wx: Fix listCtrl sort callback --- lib/wx/c_src/gen/wxe_funcs.cpp | 2 +- lib/wx/c_src/wxe_callback_impl.cpp | 2 +- lib/wx/c_src/wxe_callback_impl.h | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/wx/c_src') diff --git a/lib/wx/c_src/gen/wxe_funcs.cpp b/lib/wx/c_src/gen/wxe_funcs.cpp index 3f5cb4c0f5..8da517ee64 100644 --- a/lib/wx/c_src/gen/wxe_funcs.cpp +++ b/lib/wx/c_src/gen/wxe_funcs.cpp @@ -15875,7 +15875,7 @@ case wxListCtrl_SortItems: { // wxListCtrl::SortItems taylormade callbackInfo* cb = new callbackInfo(); cb->port = Ecmd.port; cb->callbackID = sortCallback; - bool Result = This->SortItems(wxEListCtrlCompare, (long)cb); + bool Result = This->SortItems(wxEListCtrlCompare, (wxeIntPtr)cb); delete cb; /* Destroy the callback, see wxEPrintout::clear_cb */ diff --git a/lib/wx/c_src/wxe_callback_impl.cpp b/lib/wx/c_src/wxe_callback_impl.cpp index e06f68dcbf..3a59004eb0 100644 --- a/lib/wx/c_src/wxe_callback_impl.cpp +++ b/lib/wx/c_src/wxe_callback_impl.cpp @@ -284,7 +284,7 @@ EwxListCtrl::~EwxListCtrl() { * wxListCtrlCompare wrapper * ****************************************************************************/ -int wxCALLBACK wxEListCtrlCompare(long item1, long item2, long callbackInfoPtr) +int wxCALLBACK wxEListCtrlCompare(wxeIntPtr item1, wxeIntPtr item2, wxeIntPtr callbackInfoPtr) { callbackInfo * cb = (callbackInfo *)callbackInfoPtr; wxeMemEnv * memenv = ((WxeApp *) wxTheApp)->getMemEnv(cb->port); diff --git a/lib/wx/c_src/wxe_callback_impl.h b/lib/wx/c_src/wxe_callback_impl.h index 1c355e4d38..ecfcd3db41 100644 --- a/lib/wx/c_src/wxe_callback_impl.h +++ b/lib/wx/c_src/wxe_callback_impl.h @@ -23,6 +23,13 @@ void pre_callback(); void handle_event_callback(ErlDrvPort port, ErlDrvTermData process); +#if wxCHECK_VERSION(2,9,0) + #define wxeIntPtr wxIntPtr +#else + // This is bad but how it was in wx-2.8 + #define wxeIntPtr long +#endif + /* Fun Callback id */ class wxeEvtListener : public wxEvtHandler { @@ -88,6 +95,6 @@ struct callbackInfo { int callbackID; }; -int wxCALLBACK wxEListCtrlCompare(long item1, long item2, long callbackInfoPtr); +int wxCALLBACK wxEListCtrlCompare(wxeIntPtr item1, wxeIntPtr item2, wxeIntPtr callbackInfoPtr); #endif -- cgit v1.2.3