unnamed stucts

Brad Schick <[email protected]>
Newsgroups gmane.comp.python.pyrex
Message-ID <[email protected]>
Is there a way to declare cdef data structures with nested nameless
structs? Actually I haven't managed to declare any nested structs (named
or unnamed). Is it possible? Seems like this would be a FAQ, but I
haven't yet found the answer.

An example C declaration is below. I believe this is not standard C, but
it is supported by most C compilers (at least all those I've used).

typedef union {
    struct {
        uint32_t lo;
        uint32_t hi;
    };
    struct {
        uint8_t lobytes[4];
        uint8_t hibytes[4];
    };
    uint8_t bytes[8];
} nonce_t;

If I extract the nested stuct declarations and give them names, I assume
the generated C would not compile correctly since it will #include the
original nameless C declaration.

Thanks,
-Brad
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.