rust-lang / rust-bindgen

Automatically generates Rust FFI bindings to C (and some C++) libraries.
https://rust-lang.github.io/rust-bindgen/
BSD 3-Clause "New" or "Revised" License
4.23k stars 679 forks source link

UINTMAX64 can never be generated #2822

Open jbaublitz opened 2 months ago

jbaublitz commented 2 months ago

Hi @emilio, while working on the fix for the case that wasn't handled in #2779, I noticed that bindgen can't support generating bindings for UINTMAX64. This is largely because all integers eventually get represented as an i64 so i64::MAX is the upper limit for u64 too. Is there any interest in a PR to support differentiating between u64 and i64 so that UINTMAX64 can be represented in bindgen?

pvdrz commented 1 month ago

:wave:

Right now, bindgen depends on cexpr to process object-like #define directives. AFAIK, that crate is abandoned and hasn't received any updates in 3 years. There's some ongoing work on migrating bindgen to cmacro which should handle such cases correctly.

jbaublitz commented 1 month ago

Okay, is the work under control right now? I'm happy to help out, but if it's already in progress that's fine.