Open Sean1708 opened 8 years ago
#[repr(u8)], etc. control the size of a C-like enum, there doesn't seem to be a portable way of specifying this in C but I could be missing something.
#[repr(u8)]
#[repr(packed)] removes any padding in the item. Maybe this can be done with
#[repr(packed)]
#pragma pack(push) #pragma pack(1) // ... #pragma pack(pop)
but I'm not yet sure whether there are any guarantees that the two are equivalent.
#[repr(u8)]
, etc. control the size of a C-like enum, there doesn't seem to be a portable way of specifying this in C but I could be missing something.#[repr(packed)]
removes any padding in the item. Maybe this can be done withbut I'm not yet sure whether there are any guarantees that the two are equivalent.