.cargo/vendor/cbindgen/tests/rust/const_generics.rs
raw| 1 | #[repr(transparent)] |
| 2 | pub struct CArrayString<const CAP: usize> { |
| 3 | pub chars: [i8; CAP], |
| 4 | } |
| 5 | |
| 6 | pub const TITLE_SIZE: usize = 80; |
| 7 | |
| 8 | #[repr(C)] |
| 9 | pub struct Book { |
| 10 | pub title: CArrayString<TITLE_SIZE>, |
| 11 | pub author: CArrayString<40>, |
| 12 | } |
| 13 | |
| 14 | #[no_mangle] |
| 15 | pub extern "C" fn root(a: *mut Book) {} |