Use wxEVENT_HANDLER_CAST() in socket sample

This macro avoids a -Wcast-function-type from gcc 8+.
This commit is contained in:
Vadim Zeitlin 2023-07-04 02:03:35 +02:00
parent 008e72c3ac
commit 4040e35f41
2 changed files with 2 additions and 2 deletions

View file

@ -27,7 +27,7 @@
#include "wx/thread.h"
const wxEventType wxEVT_WORKER = wxNewEventType();
#define EVT_WORKER(func) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_WORKER, -1, -1, (wxObjectEventFunction) (wxEventFunction) (WorkerEventFunction) & func, (wxObject *) nullptr ),
#define EVT_WORKER(func) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_WORKER, -1, -1, wxEVENT_HANDLER_CAST(WorkerEventFunction, func), (wxObject *) nullptr ),
const int timeout_val = 1000;

View file

@ -64,7 +64,7 @@ const char *GetSocketErrorMsg(int pSockError)
//event sent by workers to server class
//after client is served
const wxEventType wxEVT_WORKER = wxNewEventType();
#define EVT_WORKER(func) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_WORKER, -1, -1, (wxObjectEventFunction) (wxEventFunction) (WorkerEventFunction) & func, (wxObject *) nullptr ),
#define EVT_WORKER(func) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_WORKER, -1, -1, wxEVENT_HANDLER_CAST(WorkerEventFunction, func), (wxObject *) nullptr ),
class WorkerEvent : public wxEvent
{