[Cython] Add support for the offsetof() C macro

Emmanuel Gil Peyrot linkmauve at linkmauve.fr
Wed Apr 3 10:55:32 CEST 2013


Hi,

offsetof() is not supported by current Cython, and I have not found any
workaround (except hardcoding offsets for a specific architecture and
compiler, but this is obviously wrong).

offsetof(struct_type, member) is a C macro that expands to the offset
of the member in the struct, in bytes.  Could you add support for it,
perhaps like sizeof as a special case in the parser?

And many thanks for the whole project! ☺

-- 
Emmanuel Gil Peyrot
XMPP: <linkmauve at linkmauve.fr>
OpenPGP: 24B1D609
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20130403/ca6ad49c/attachment.pgp>


More information about the cython-devel mailing list