Commit Graph

28 Commits

Author SHA1 Message Date
月出皎兮 83fcd6d5e2 bindgen升级0.70.1版本
Signed-off-by: 月出皎兮 <xietingwei@h-partners.com>
2025-04-15 20:47:01 +08:00
Eric Seppanen 80f64637f5 allow custom derives on enums
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.
2021-11-26 02:33:39 +01:00
Adam Perry 7ca46f6f26 Integration test include directory paths for depfiles. 2021-04-24 00:51:44 +02:00
Corey Farwell c6eb7c9d12 Add failing regression test for #1973. 2021-01-30 16:48:20 +01:00
Emilio Cobos Álvarez cd27daf3be tests: Remove unnecessary system header include that makes macos unhappy 2020-12-26 19:01:53 +01:00
Youmu 4656d34773 Add integration test for name matching 2020-09-15 00:18:51 +02:00
Darren Kulp 21b1159f48 Introduce tests for functional macros 2020-06-21 01:40:52 +02:00
Alan Egerton fae2f4731c Refined test to verify type of resulting integer 2020-06-15 21:53:48 +01:00
Emilio Cobos Álvarez b72575fdc5 Add a test for the interaction between blacklisting and parse callbacks. 2018-11-30 06:21:44 +01:00
chrysn bbaf6c6b6c Integration tests for str_macro callbacks 2018-11-26 16:00:22 +01:00
Sébastien Duquette 2f0aea26ce Add tests for renamed structure items 2018-11-10 20:32:29 -05:00
Sébastien Duquette 5820d34edb Add integration tests 2018-11-10 19:16:54 -05:00
Emilio Cobos Álvarez 349cfe86a4 ir: Don't assume wchar is 2 bytes.
Fixes #1345
2018-07-05 02:32:28 +02:00
bors-servo 1686d9f838 Auto merge of #1243 - emilio:parse-callbacks, r=fitzgen
callbacks: Introduce MacroParsingBehavior to allow ignoring macros.

This is symmetric, yet less powerful, than enum_variant_behavior.

Fixes #687.
2018-01-31 11:26:31 -06:00
Emilio Cobos Álvarez 8cf8aaff90 callbacks: Introduce MacroParsingBehavior to allow ignoring macros.
This is symmetric, yet less powerful, than enum_variant_behavior.

Fixes #687.
2018-01-31 00:00:57 +01:00
Emilio Cobos Álvarez 5eb46a96b1 ir: Choose the right mangling for destructors on all codepaths.
Fixes #1133.
2018-01-29 15:48:34 +01:00
Emilio Cobos Álvarez 604989c361 Don't generate symbols for pure virtual functions.
Fixes #1197.
2017-12-29 17:18:20 +01:00
Nick Fitzgerald c930acc14f Support bitfield allocation units larger than 64 bits
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.
2017-11-21 13:55:00 +00:00
Emilio Cobos Álvarez 63b7c22d77 codegen: Fix bitfield getter/setters so they work with NPOT sizes. 2017-06-18 02:09:28 +02:00
Emilio Cobos Álvarez 016e72a626 ir: Fix a bunch of bitfield correctness issues.
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).
2017-06-05 20:05:01 +02:00
Emilio Cobos Álvarez d33bdcee48 codegen: Add integration tests for destructors. 2017-04-04 01:05:35 +02:00
Adam Baxter b61601ab25 Renamed chooser to visitor and added function for parsed macro analysis.
Added tests and fixed missed function rename.

Fixed nits

Renamed visitor to callbacks.

Renamed visitor to callbacks.

Renamed visitor to callbacks.

Fixed text.
2017-03-17 21:36:46 -04:00
Nick Fitzgerald ad4013130e Reintroduce bitfield accessors
This commit reintroduces accessor methods for bitfields in the generated
bindings.

Fixes #519
2017-03-09 09:55:57 -08:00
Emilio Cobos Álvarez ff71d278f2 tests: Add an integration test for static arrays.
Turns out they were broken before
https://github.com/servo/rust-bindgen/issues/456.

Let's test it so it doesn't regress.
2017-01-30 00:17:28 +01:00
Emilio Cobos Álvarez 9800350d9c codegen: Fix typedef re-export in namespaces when bindings aren't at the root. 2017-01-24 09:58:58 +01:00
Emilio Cobos Álvarez 2e8a2f7ac1 codegen: Fix use generation for non-root module. 2017-01-13 21:40:17 +01:00
Emilio Cobos Álvarez 9b17ee9482 Fix travis 2016-12-13 14:49:40 +01:00
Emilio Cobos Álvarez 641e555fde Add support for constructors, and integration tests. 2016-12-13 14:33:01 +01:00