Sean1708 / rusty-cheddar

A Rust crate for automatically generating C header files from Rust source file.
http://sean1708.github.io/rusty-cheddar/
191 stars 25 forks source link

Support other representations. #33

Open Sean1708 opened 8 years ago

Sean1708 commented 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(packed)] removes any padding in the item. Maybe this can be done with

#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.