[Pyrex] typedef enum

Phillip J. Eby pje at telecommunity.com
Thu Jun 3 17:15:13 CEST 2004


At 05:27 PM 6/3/04 +1000, Tom Kobialka wrote:

>  I don't think I can translate the following into pyrex, is there some 
> way I can circumvent the #ifdef issue?
>
>         typedef struct FrIO{
>                 #ifdef FRIOCFILE
>                   FILE *fp;
>                 #else
>                   int fd;
>                 #endif
>                 char buffer[FRIOBSIZE];
>                 int  position ;

No need to circumvent it.  Just ignore it.  You can include either fp, fd, 
or both, or neither.  Include whichever ones you expect to use.

Because Pyrex isn't a C compiler, it doesn't need to know the actual 
structure layout.  It just needs to know the names and types of the fields 
you intend to use.  The C compiler will do the rest.





More information about the Pyrex mailing list