We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
--features use-bindgen
1 parent 0545cad commit 4ef336dCopy full SHA for 4ef336d
src/sdl2/keyboard/mod.rs
@@ -191,7 +191,10 @@ impl KeyboardUtil {
191
192
#[doc(alias = "SDL_SetModState")]
193
pub fn set_mod_state(&self, flags: Mod) {
194
- let arg = sys::SDL_Keymod(flags.bits() as u32);
+ // Note: Clang (and therefore bindgen) generates different integer types
195
+ // for C-style enums on different platforms. On Windows, the underlying
196
+ // type is `i32`, while on Linux it is `u32`.
197
+ let arg = sys::SDL_Keymod(flags.bits().into());
198
unsafe {
199
sys::SDL_SetModState(arg);
200
}
0 commit comments