[Pyrex] Re: Problem with unions and nested structs

Mike Rovner mike at bindkey.com
Wed Jun 11 20:18:20 CEST 2003


"Geoffrey Bantle" <hairbat at yahoo.com> wrote in message
news:20030611132858.39171.qmail at web41308.mail.yahoo.com...
> ctypedef union VNTag:
> boolean active
> uint32 integer
> double real
> char *string
> double vector[3]
> VNodeID link
> cdef struct animation:
> VNodeID curve
> uint32 start
> uint32 end
> cdef struct blob
> uint32 blob_size
> void *blob

Unfortunately you posted the code in such way that my OE newsreader is
unable to detect indentation.

Don't declare one cdef inside another. They all shall be on top level.
First declare animation, then inside union say Animation animation:

cdef struct Animation:
   ...

cdef union XXX:
  ...
  Animation animation
  ...

Hope this helps,
Mike







More information about the Pyrex mailing list