Re: unnamed stucts

Greg Ewing <[email protected]>
Newsgroups gmane.comp.python.pyrex
Message-ID <[email protected]>
Brad Schick wrote:
> Thanks for the feedback, but I'm not sure I see that. Pyrex won't
> compile the code unless I use the names of the nested structs when
> referencing those elements.

Sorry, I must have been thinking of named nested structs when
I wrote that.

What you should do is flatten the struct and declare all the
members of the nested structs and unions directly as members of
the containing struct.

e.g. given your example,

   cdef extern from "header.h":
     unsigned lo
     unsigned hi
     unsigned short lobytes[4]
     unsigned short hibytes[4]
     unsigned char bytes[8]

-- 
Greg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.