Support an annotation for generating bitfield sizes in C code (: SIZE)
Closes #609 Closes #611
This commit is contained in:
committed by
Emilio Cobos Álvarez
parent
dc12952e19
commit
a689bcabc7
Generated
+5
@@ -0,0 +1,5 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "bitfield"
|
||||
version = "0.1.0"
|
||||
@@ -0,0 +1,7 @@
|
||||
[package]
|
||||
name = "bitfield"
|
||||
version = "0.1.0"
|
||||
authors = ["cbindgen"]
|
||||
|
||||
[features]
|
||||
cbindgen = []
|
||||
@@ -0,0 +1,3 @@
|
||||
[parse.expand]
|
||||
crates = ["bitfield"]
|
||||
features = ["cbindgen"]
|
||||
@@ -0,0 +1,15 @@
|
||||
#[repr(C)]
|
||||
pub struct HasBitfields {
|
||||
#[cfg(not(feature = "cbindgen"))]
|
||||
foo_and_bar: u64,
|
||||
|
||||
#[cfg(feature = "cbindgen")]
|
||||
/// cbindgen:bitfield=8
|
||||
foo: u64,
|
||||
#[cfg(feature = "cbindgen")]
|
||||
/// cbindgen:bitfield=56
|
||||
bar: u64,
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn root(_: &HasBitfields) {}
|
||||
Reference in New Issue
Block a user