From 38cdc38bba623f4d921660e91f21042937a25514 Mon Sep 17 00:00:00 2001 From: historic_bruno Date: Wed, 17 Jul 2013 06:33:11 +0000 Subject: [PATCH] Fixes a build error with SDL2, refs #2041 This was SVN commit r13572. --- source/gui/CDropDown.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/gui/CDropDown.cpp b/source/gui/CDropDown.cpp index b8993196e5..9001d1afd3 100644 --- a/source/gui/CDropDown.cpp +++ b/source/gui/CDropDown.cpp @@ -281,7 +281,12 @@ InReaction CDropDown::ManuallyHandleEvent(const SDL_Event_* ev) // If we have imputed a character try to get the closest element to it. // TODO: not too nice and doesn't deal with dashes. if (m_Open && ((szChar >= SDLK_a && szChar <= SDLK_z) || szChar == SDLK_SPACE - || (szChar >= SDLK_0 && szChar <= SDLK_9) || (szChar >= SDLK_KP0 && szChar <= SDLK_KP9))) + || (szChar >= SDLK_0 && szChar <= SDLK_9) +#if !SDL_VERSION_ATLEAST(2,0,0) + || (szChar >= SDLK_KP0 && szChar <= SDLK_KP9))) +#else // SDL2 + || (szChar >= SDLK_KP_0 && szChar <= SDLK_KP_9))) +#endif { // arbitrary 1 second limit to add to string or start fresh. // maximal amount of characters is 100, which imo is far more than enough.