SDL-agnostic way to declare callback func. for SDL_SetEventFilter()
SDL 1.2 wants a "const SDL_Event *", SDL 2.0 wants a "union SDL_Event *".
This commit is contained in:
parent
2e0119daa9
commit
ff05e91f39
1 changed files with 7 additions and 2 deletions
|
|
@ -580,8 +580,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(const SDL_Event * event);
|
||||
int TP_EventFilter(EVENT_FILTER_EVENT_TYPE * event);
|
||||
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
|
|
@ -26674,7 +26679,7 @@ static void do_lock_file(void)
|
|||
/**
|
||||
* FIXME
|
||||
*/
|
||||
int TP_EventFilter(const SDL_Event * event)
|
||||
int TP_EventFilter(EVENT_FILTER_EVENT_TYPE * event)
|
||||
{
|
||||
if (event->type == SDL_QUIT ||
|
||||
event->type == SDL_ACTIVEEVENT ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue