Closed VariableExp0rt closed 3 months ago
It is intentional that we don't remove typedefs by default, unless very specific (e.g. we do detect standard uint8_t
and so).
You could do this manually by doing something like:
.blocklist_type("__u8")
.raw_line("pub type __u8 = u8;")
Or so, tho, right?
@emilio I could definitely do that, I just didn't know whether I was missing something. Thanks for the pointer, I'll try this!
Yeah we don't assume anything other than standard types generally, so that seems like the best way to go. No worries!
@emilio do you know why none of the _bindgen_anon fields that are either anonymous unions or structs and point to new __bindgen_ty
types are not Copy
or Clone
derivable?
pub inner1: io_uring_sqe__bindgen_ty_1,
#[repr(C)]
pub struct io_uring_sqe__bindgen_ty_1 {
pub off: __BindgenUnionField<__u64>,
pub addr2: __BindgenUnionField<__u64>,
pub inner1: __BindgenUnionField<io_uring_sqe__bindgen_ty_1__bindgen_ty_1>,
pub bindgen_union_field: u64,
}
That should work, if you could file an issue with a reduced test-case it'd be appreciated.
@emilio as requested https://github.com/rust-lang/rust-bindgen/issues/2785.
This is more of a question than an issue. Is there currently a way to replace the "reserved for the implementation" types that are prefixed with a double underscore into their Rust native counterparts (I use that term loosely as I realise they will not exactly the same)?
I am new to bindgen, so it might be that this is by design. Looking at https://github.com/spacejam/rio/blob/master/src/io_uring/kernel_types.rs#L35, I see this has probably been hand crafted/modified, but I was wondering if there is anyway to do this with the library API?
Thanks!
Input C/C++ Header
Bindgen Invocation
Actual Results
Expected Results