From a9ef0d38fa9b1e49b3c286fb5633ae603a3aa9dc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 15 Sep 2017 05:43:59 +0300 Subject: Fix compilation with SDL 2 < 2.0.6. --- src/input/joystick.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/input/joystick.cpp b/src/input/joystick.cpp index dce9d1922..fc4b8434d 100644 --- a/src/input/joystick.cpp +++ b/src/input/joystick.cpp @@ -117,10 +117,12 @@ bool Joystick::open() for (int f = 0; f < 16; f ++) guidStr.append(strprintf("%02x", CAST_U32(guid.data[f]))); logger->log("Guid: %s", guidStr.c_str()); +#if SDL_VERSION_ATLEAST(2, 0, 6) logger->log("Device id: %u:%u.%u", CAST_U32(SDL_JoystickGetVendor(mJoystick)), CAST_U32(SDL_JoystickGetProduct(mJoystick)), CAST_U32(SDL_JoystickGetProductVersion(mJoystick))); + SDL_JoystickType type = SDL_JoystickGetType(mJoystick); std::string typeStr; switch (type) @@ -158,6 +160,7 @@ bool Joystick::open() break; } logger->log("Type: " + typeStr); +#endif // SDL_VERSION_ATLEAST(2, 0, 6) // probably need aslo dump SDL_JoystickCurrentPowerLevel #else // USE_SDL2 -- cgit v1.2.3-70-g09d2