cbindgen
cbindgen copied to clipboard
Small problem in const support of array initialization
Hello, I noticed that this doesn't work (cbindgen doesn't generate the struct definition):
const LENGTH: usize = 127;
#[repr(C)]
pub struct Data {
pub d: [u8; LENGTH + 1],
}
After finding about https://github.com/eqrion/cbindgen/issues/53, I changed it to this and it now works:
const LENGTH: usize = 127 + 1;
#[repr(C)]
pub struct Data {
pub d: [u8; LENGTH],
}
It's not such a big deal for me, but maybe it's worth investigating at some point. If it's trivial, let me know and I might make the change myself. Thanks!
Yeah, I'd expect that to work. We should probably dig a bit where stuff is going wrong.