* codegen: Look through typedefs to detect void return type.
And reuse a bit more code.
Should fix#2377, but needs a test (can't run tests atm).
* Add tests
* Run rustfmt
* Update changelog
Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com>
This PR introduces a new non-exhaustive `struct` called `DeriveInfo` to be used as the sole argument of `ParseCallbacks::add_derives` with the purpose of being able to extend the information passed to this method in a backwards-compatible manner, meaning that adding new fields to `DeriveInfo` won't be a breaking change when releasing a new version.
* Add the `--override-abi` option.
This option can be used from the CLI with the <abi>:<regex> syntax and
it overrides the ABI of a function if it matches <regex>.
Fixes#2257
* tests: Avoid using globs as regexes
* Sanitize regex set input to properly handle alternation
* Add test case for alternates/anchors interaction
* emit warning if wildcard pattern is used
* update changelog and bump versions
Co-authored-by: Darren Kulp <darren@kulp.ch>
Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com>
This is done by moving all the remaining `Builder` state into
`BindgenOptions` so any internal logic that affects `Builder` state only
runs once the builder is consumed by `Builder::generate`:
- move `input_headers` to `BindgenOptions`.
- move `input_header_contents` to `BindgenOptions`.
- derive `Clone` for `Builder`.
Generated code needs some sorting in a way that is
semantically appealing. The request[1] asks for basic
sorting like "types are declared first, then all structs,
then all consts, then all function signatures, etc.
[1] https://github.com/rust-lang/rust-bindgen/issues/1743
Signed-off-by: Amanjeev Sethi <aj@amanjeev.com>
Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com>
Co-authored-by: Darren Kulp <darren@kulp.ch>
* Updated tests/expectations/Cargo.toml to use 2018 rust.
* Added Debug and Copy to objective-c structs.
* Fixed lifetimes in objective-c trait templates.
* Fixed imports for objective-c expectations tests.