Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bindgen produces inconsistent enum types when run on windows vs linux #15

Open
aloucks opened this issue Aug 26, 2024 · 0 comments
Open

Comments

@aloucks
Copy link
Owner

aloucks commented Aug 26, 2024

The raw C enum types end up as libc::c_int or libc::c_uint depending on which platform they are generated on. This is an issue with clang/bindgen. The C spec states that enums should be int but bindgen uses whatever comes out of clang and clang is producing the u32 on linux. This doesn't really create a problem in the user facing API but does mean that regenerating the bindings from different platforms requires manual fixup (either manually update the generated code or manually change the Rust enum representations).

See:

rust-lang/rust-bindgen#1966

rust-lang/rust-bindgen#1907

@aloucks aloucks changed the title Bindgen produces inconsistent results when run on windows vs linux Bindgen produces inconsistent enum types when run on windows vs linux Aug 26, 2024
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

No branches or pull requests

1 participant