Skip to content

Commit

Permalink
Mention blocklisting bitfield types in book
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-h-chamberlain authored and emilio committed Jun 18, 2024
1 parent 0e4a5cc commit 9452ba1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions book/src/using-bitfields.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ As Rust does not support bitfields, Bindgen generates a struct for each with the
* For each contiguous block of bitfields, Bindgen emits an opaque physical field that contains one or more logical bitfields
* A static constructor ```new_bitfield_{1, 2, ...}``` with a parameter for each bitfield contained within the opaque physical field.

To keep bindgen from generating the bitfield unit struct, it can be blocklisted like any
other type, i.e. `--blocklist-type "__BindgenBitfieldUnit"`. This may be useful if
you want to define a custom implementation, or your generated bindings import a
pre-existing definition for the bitfield unit type.

## Bitfield examples

For this discussion, we will use the following C type definitions and functions.
Expand Down

0 comments on commit 9452ba1

Please sign in to comment.