You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
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
The raw C enum types end up as
libc::c_int
orlibc::c_uint
depending on which platform they are generated on. This is an issue with clang/bindgen. The C spec states that enums should beint
but bindgen uses whatever comes out of clang and clang is producing theu32
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
The text was updated successfully, but these errors were encountered: