From f8b5627bd8766ff4d5579a02f566b76408b1600f Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Fri, 28 Dec 2018 05:22:17 -0800 Subject: [PATCH] fix support for old SDL versions Check for at least SDL 2.0.6 when using the SDL_JoystickGetAxisInitialState() API introduced in e57beed8. --- src/wx/widgets/sdljoy.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wx/widgets/sdljoy.cpp b/src/wx/widgets/sdljoy.cpp index 897a2103..aafc2696 100644 --- a/src/wx/widgets/sdljoy.cpp +++ b/src/wx/widgets/sdljoy.cpp @@ -135,9 +135,11 @@ void wxSDLJoy::Notify() val = SDL_JoystickGetAxis(dev, j); // trigger axes always return max negative value, we ignore these +#if SDL_VERSION_ATLEAST(2, 0, 6) int16_t initial_state; if (SDL_JoystickGetAxisInitialState(dev, j, &initial_state) && val == initial_state) continue; +#endif if (digital) { if (val > 0x3fff)