Age | Commit message (Collapse) | Author |
|
Update Item to hold a `clang::SourceLocation` and use this to allow
blocklisting based on filename.
The existing code has a special case that always maps <stdint.h> integer
types to corresponding Rust integer types, even if the C types are
blocklisted. To match this special case behaviour, also treat these
C <stdint.h> types as being eligible for derived Copy/Clone/Debug
traits.
Fixes #2096
|
|
|
|
|
|
|
|
If a struct needs to be serialized in its native format (padding bytes
and all), for example writing it to a file or sending it on the network,
then explicit padding fields are necessary, as anything reading the
padding bytes of a struct may lead to Undefined Behavior.
|
|
Closes #2045.
Fixes #1252.
|
|
Needed to auto-bindgen with a ninja build without the build graph
going stale.
|
|
|
|
Fixes #430
|
|
This reverts commit 7286c815f80b14c0ee77773387434da40f511b42, because it
was not intended to be merged after all, see
https://github.com/rust-lang/rust-bindgen/pull/2003#issuecomment-796160427.
|
|
Fixes #1454
|
|
For the commandline arguments I added undocumented aliases to old flags,
to stay backwards compatible.
|
|
|
|
Add a `--fit-macro-constant-types` option to make bindgen try to fit
macro integer constants into types smaller than u32/i32.
Useful especially when dealing with 8/16-bit architectures.
Closes #1945
|
|
This makes command_line_args properly return them, instead of dropping
them on the floor.
|
|
Sometimes, we need customize the implement of `Default` for certain types,
In these cases, the `nodefault` annotation can be used to prevent bindgen
to autoderive the `Default` traits for a type.
|
|
Closes #1541.
Closes #1846.
Co-authored-by: Michael-F-Bryan <michaelfbryan@gmail.com>
|
|
* --default-macro-constant-type could be 'signed' or 'unsigned'
* Its default value is 'unsigned' to use u32/u64
for C macro constants that fit into the u32/u64 ranges.
* For old C libraries that use macros as int/long parameter
and/or return value types, their macros are better declared
as i32/i64 if the values fit the i32/i64 ranges,
to be compatible with c_int/c_long types.
They can use "--default-macro-constant-type signed"
|
|
|
|
|
|
Allow to use the given prefix for the anon fields instead of `__bindgen_anon_`.
|
|
|
|
|
|
One more thing that we can configure from the command line.
|
|
|
|
|
|
This adds an enum style similar to the existing bitfield style, without
the bitwise operator impls.
Closes: #1669
|
|
|
|
The following structs have different names for C and C++. In case of C
they are visible as `foo` and `bar`. In case of C++ they are visible as
`foo` and `foo::bar`. By default bindgen follows C++ naming to avoid
generating duplicate names.
With this option the following structs will be named as `foo`
and `bar` instead of `foo` and `foo_bar`.
```
struct foo {
struct bar {
} b;
};
```
In case of an unnamed definition we build the canonical name from
the inner most named definition. For example the following will
generate `baz__bindgen_ty_1`:
```
struct foo {
struct bar {
struct baz {
struct {
} u;
} z;
} b;
};
```
This option should be used only for C headers. It is needed in some
rare situations where user used another code generator that already
mangled nested definitions.
A real life example is [asn1c] with `-fcompound-names` option.
[asn1c]: https://github.com/vlm/asn1c
|
|
|
|
|
|
Fixes #1598
|
|
Implements the feature discussed in
https://github.com/rust-lang/rust-bindgen/issues/1554.
|
|
|
|
|
|
And don't do it conditionally on the presence of --target. We pass the clang
arguments to clang-sys now, so it doesn't get the wrong path.
|
|
|
|
Given it was a considerable performance hit under some workloads.
Closes #1465.
|
|
|
|
(regardless of which sort of Item they are)
|
|
Since #1378 broke a bunch of OSX builds.
Most people don't care about them and they're in some OSX system headers which
means that this could break normal C and C++ stuff.
This introduces --generate-block / generate_block to generate these signatures,
and adds tests so that this is getting tested.
|
|
|
|
before, bindgen -- -I blah would try to open `-I` as a header file.
|
|
|
|
Fixes #1336
|
|
|
|
|
|
|
|
They do nothing, and are effectively superseded by --raw-line and friends.
They also tend to confuse people.
Closes #104
|
|
Use the ? operator instead of try, and add some more uses of it on Option<> that
were straight-forward.
|