Skip to content

Commit

Permalink
Fixed bug 5242 - KMOD_* flags unnecessarily macros; breaks OGRE
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slouken committed Aug 10, 2020
1 parent c094332 commit 86517d3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/SDL_keycode.h
Expand Up @@ -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_ */

Expand Down

0 comments on commit 86517d3

Please sign in to comment.