[Pyrex] conditional types from C headers

Michal Pasternak michal at pasternak.w.lub.pl
Tue Jun 29 02:06:50 CEST 2004


Phil Frost [Mon, Jun 28, 2004 at 07:43:16PM -0400]:
> In C it's rather common to have typedefs within #ifdef statements, for
> example, size_t, uint32_t, etc. Is there any way to tell pyrex, "there
> is a type called 'size_t', so just use it and let the C compiler do the
> rest"? From what I can tell, If i do "ctypedef fu bar", then pyrex
> translates all bars to fus, so the compiler and preprocessor can't do
> their "magic". Any way to solve this?

	http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/version/Doc/overview.html#ReferencingHeaders

Anyway, I had some trouble with int??_t - don't do that with Pyrex (unless
you have better luck, than me), I think it's much easier just to typedef
your types according to the compiler you use in some separate file, to
easily write a new one, for another compiler/architecture.




More information about the Pyrex mailing list