From dcc699eea1c640de98f0e24788b382d3d35a32d1 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Thu, 19 May 2022 01:36:47 -0700 Subject: [PATCH] Merge SDL-agnostic way to declare callback func. for SDL_SetEventFilter() --- src/tuxpaint.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index f6578f32d..851fad154 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -601,8 +601,13 @@ static void reposition_onscreen_keyboard(int y); #endif #endif +#if (SDL_MAJOR_VERSION < 2) + #define EVENT_FILTER_EVENT_TYPE const SDL_Event +#else + #define EVENT_FILTER_EVENT_TYPE union SDL_Event +#endif -int TP_EventFilter(void *data, union SDL_Event * event); +int TP_EventFilter(void *data, EVENT_FILTER_EVENT_TYPE * event); /* *INDENT-OFF* */ @@ -27174,7 +27179,7 @@ static void do_lock_file(void) free(lock_fname); } -int TP_EventFilter(__attribute__((unused)) void *data, union SDL_Event * event) +int TP_EventFilter(__attribute__((unused)) void *data, EVENT_FILTER_EVENT_TYPE * event) /** * FIXME */