Issue 37 in ctypesgen: Feature request: support #pragma pack

7 views
Skip to first unread message

codesite...@google.com

unread,
Jan 13, 2013, 6:20:35 AM1/13/13
to ctyp...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 37 by sigma...@gmail.com: Feature request: support #pragma pack
http://code.google.com/p/ctypesgen/issues/detail?id=37

First of all I'd like to say thanks for creating such a useful project. I
am using it to generate a python ctypes interface for the GSSAPI library on
Mac OS X and have found one place I need to manually edit the generated
code - the header for the library contains:

#pragma pack(push,2)
... struct definitions ...
#pragma pack(pop)

and when ctypesgen creates the Structure classes for each struct it omits
to add a _pack_=2 class attribute, so the alignment of the structs isn't
right.
Editing the generated code fixes the problem but it would be great to have
support for #pragma pack in ctypesgen.

codesite...@google.com

unread,
Jun 4, 2014, 10:13:46 AM6/4/14
to ctyp...@googlegroups.com

Comment #1 on issue 37 by mike...@gmail.com: Feature request: support
#pragma pack
http://code.google.com/p/ctypesgen/issues/detail?id=37

PLY, which seems to be what the lex/yacc code in ctypesgen is based on,
doesn't appear to handle pragma directives. That means that there doesn't
seem to be a pragam token, let alone dealing with the token and
constructing the right attributes for it, so this would likely require a
fair amount of effort...

This is also related to issue 46.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages