summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp')
-rw-r--r--Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp
index 5473f7bcb3..b521032e9c 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp
+++ b/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp
@@ -325,7 +325,13 @@ bool Joystick::UpdateOutput()
std::string Joystick::GetName() const
{
- return StripSpaces(SDL_JoystickName(m_sdl_index));
+ return StripSpaces(
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+ SDL_JoystickNameForIndex(m_sdl_index)
+#else
+ SDL_JoystickName(m_sdl_index)
+#endif
+ );
}
std::string Joystick::GetSource() const