Make ParseCallbacks::int_macro available to the CLI
As per https://github.com/rust-lang/rust-bindgen/issues/3098 and https://github.com/rust-lang/rust-bindgen/issues/3200, currently clang doesn't provide sufficient type information to tell if a macro generated integer is a u64, a u32, or anything else.
As such and until a time when clang does provide the necessary detail, it would be nice to have an override and a fallback option available. Essentially, a fallback type for all integer generating macros, and then individual overrides on a per item basis.
Filing this issue so that it can be tracked separately from the "waiting for clang api changes" issue.
Isn't this basically a combo of the existing three options:
- ParseCallbacks::int_macro (per macro override)
- default_macro_constant_type (global tweak)
- fit_macro_constants (global tweak)
Or am I missing something? Please reopen if so.
Are those accessible by the CLI? My current experiments have been purely using the CLI, so I don't know about the API surface.
--fit-macro-constant-types and --default-macro-constant-type are accessible to the CLI. int_macro could be exposed perhaps.
Yeah, adding a per-macro override (exposing int_macro to the CLI) would be a nice feature to have. Also the docs in CLI for --fit-macro-constant-types currently says Try to fit macro constants into types smaller than u32/i32, but I'm assuming that changes to "smaller than 'default'" when setting the default to u64?
I apparently don't have permission to reopen the issue from my end, but I would appreciate this tracking the CLI per macro override.