Skip to content

Conversation

@renski-dev
Copy link
Contributor

@renski-dev renski-dev commented Nov 26, 2025

The current master commit does not compile with --features use-bindgen. Specifically, here:

let arg = sys::SDL_Keymod(flags.bits() as u32);

The compiler complains:

error[E0308]: mismatched types
    --> src\sdl2\keyboard\mod.rs:197:35
     |
 194 |         let arg = sys::SDL_Keymod(flags.bits() as u32);
     |                   --------------- ^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
     |                   |
     |                   arguments to this struct are incorrect

Clang generates different integer types for C-style enums on different platforms, i32 on Windows and u32 on Linux. After some digging, there seems to be no neat way around this as far as I can tell, other than keeping this in mind whenever we care about the specific type of the underlying value.

More info: rust-lang/rust-bindgen#1966

Also somewhat related to #1511, which is the original reason why I'm building with use-bindgen in the first place.

Copy link
Contributor

@antonilol antonilol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@antonilol antonilol requested a review from jagprog5 November 26, 2025 11:01
@jagprog5 jagprog5 merged commit 4ef336d into Rust-SDL2:master Nov 26, 2025
11 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants