Ticket #290 (closed defect: fixed)
Support for packed structs
| Reported by: | dagss | Owned by: | dagss |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.11.2 |
| Component: | Parsing | Keywords: | |
| Cc: |
Description
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).
Change History
Note: See
TracTickets for help on using
tickets.
