Fixed bug 5242 - KMOD_* flags unnecessarily macros; breaks OGRE

Rainer Deyke

While most of the KMOD_* flags are enums, the combination flags KMOD_CTRL, KMOD_ALT, KMOD_SHIFT and KMOD_GUI are defined as macros.  This breaks third-party code that uses these KMOD_* names for local identifiers, such as OGRE.  The correct thing to do is to make them all enums.
Sam Lantinga 2020-08-10 08:42:35 -07:00
parent c094332825
commit 86517d3eda
1 changed files with 6 additions and 6 deletions

View File

@ -336,13 +336,13 @@ typedef enum
KMOD_NUM = 0x1000,
KMOD_CAPS = 0x2000,
KMOD_MODE = 0x4000,
KMOD_RESERVED = 0x8000
} SDL_Keymod;
KMOD_RESERVED = 0x8000,
#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI)
KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL,
KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT,
KMOD_ALT = KMOD_LALT | KMOD_RALT,
KMOD_GUI = KMOD_LGUI | KMOD_RGUI,
} SDL_Keymod;
#endif /* SDL_keycode_h_ */