What about using const
generics (array) rather than conditional compilation?
pub struct usize_half([u8; size_of::<usize>() / 2]);
I expect this would be more cross-platform. The only problems I see are:
- Handling odd sizes (how to properly round?)
- Endianess. This would be simplified by arbitrary fixed-precision ints