Ticket #290 (closed defect: fixed)
Support for packed structs
|Reported by:||dagss||Owned by:||dagss|
Could we have some kind of keyword to define packed structs in Cython? This is not part of the C standard, but is supported in most C compilers through extensions. (Obviously one can do it now through writing a header file, but that is inconvenient.)
I.e. something like:
cdef packed struct MyStruct: char a double b
would output conditional code to do either attribute((packed)) or #pragma pack(push,1), #pragma pack(pop) (gcc/icc and Visual C, respectively).