.cargo/vendor/cbindgen/tests/rust/const_generics_constant.rs
raw| 1 | #[repr(C)] |
| 2 | pub struct FixedPoint<const FRACTION_BITS: u16> { |
| 3 | value: u16, |
| 4 | } |
| 5 | |
| 6 | pub const FONT_WEIGHT_FRACTION_BITS: u16 = 6; |
| 7 | |
| 8 | pub type FontWeightFixedPoint = FixedPoint<FONT_WEIGHT_FRACTION_BITS>; |
| 9 | |
| 10 | #[repr(C)] |
| 11 | pub struct FontWeight(FontWeightFixedPoint); |
| 12 | |
| 13 | impl FontWeight { |
| 14 | pub const NORMAL: FontWeight = FontWeight(FontWeightFixedPoint { value: 400 << FONT_WEIGHT_FRACTION_BITS }); |
| 15 | } |
| 16 | |
| 17 | #[no_mangle] |
| 18 | pub extern "C" fn root(w: FontWeight) {} |