Age | Commit message (Collapse) | Author |
|
Custom derives are just as useful on enums as they are on structs; not
supporting this was an oversight.
Adds a test that will fail to compile if the custom derive doesn't work
on enums. This test fails without the codegen fix.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fixes #1345
|
|
callbacks: Introduce MacroParsingBehavior to allow ignoring macros.
This is symmetric, yet less powerful, than enum_variant_behavior.
Fixes #687.
|
|
This is symmetric, yet less powerful, than enum_variant_behavior.
Fixes #687.
|
|
Fixes #1133.
|
|
Fixes #1197.
|
|
Individual bitfields are still limited to at most 64 bits, but this
restriction can be weakened when Rust supports u128.
This implements issue #816.
Usage notes:
* Since common code is added to each generated binding, a program which uses
more than one binding may need to work around the duplication by including
each binding in its own module.
* The values created by bitfield allocation unit constructors can be assigned
directly to the corresponding struct fields with no need for transmutation.
Implementation notes:
__BindgenBitfieldUnit represents a bitfield allocation unit using a Storage
type accessible as a slice of u8. The alignment of the unit is inherited from
an Align type by virtue of the field:
align: [Align; 0],
The position of this field in the struct is irrelevant.
The alignment of the Storage type is intended to be no larger than the
alignment of the Align type, which will be true if the Storage type is, for
example, an array of u8.
Although the double underscore (__) prefix is reserved for implementations of
C++, there are precedents for this convention elsewhere in bindgen and so the
convention is adopted here too.
Acknowledgement:
Thanks to @fitzgen for an initial implementation of __BindgenBitfieldUnit and
code to integrate it into bindgen.
|
|
|
|
In particular, the "flush the allocation unit" logic is only valid for
ms_structs (that is, MSVC).
It's slightly annoying to have this different behavior, but it'd work just fine
if we'd turn that on for MSVC.
This patch doesn't do that, yet at least, and adds tests for all the weird
bitfield alignments around.
Fixes #726 (and another set of hidden issues by the old code).
|
|
|
|
Added tests and fixed missed function rename.
Fixed nits
Renamed visitor to callbacks.
Renamed visitor to callbacks.
Renamed visitor to callbacks.
Fixed text.
|
|
This commit reintroduces accessor methods for bitfields in the generated
bindings.
Fixes #519
|
|
Turns out they were broken before
https://github.com/servo/rust-bindgen/issues/456.
Let's test it so it doesn't regress.
|
|
|
|
|
|
|
|
|