[capi-sig] python and fpos_t

Dorian Krause doriankrause at web.de
Thu Oct 9 10:25:26 CEST 2008


Hello everybody,

I stumbled about a curious problem: Including <Python.h> changes the size of fpos_t.

m01% cat fpos_python.cc 
#ifdef HAVE_PYTHON_H
#include <Python.h>
#endif /* HAVE_PYTHON_H */
#include <stdio.h>
int main(int argc, char** argv)
{
  printf("sizeof(fpos_t) = %d\n",sizeof(fpos_t));
}
m01% g++ -DHAVE_PYTHON_H -I/usr/include/python2.5 fpos_python.cc -lpython2.5 && ./a.out
sizeof(fpos_t) = 16
m01% g++ -I/usr/include/python2.5 fpos_python.cc -lpython2.5 && ./a.out 
sizeof(fpos_t) = 12

This breaks my code if I do not include <Python.h> in ALL of my compilation modules (which is not pratical in my opinion).

Is this a known problem? I personally would call this definitely a bug. What is the rational behind changing fpos_t?

Thanks.

Regards,
Dorian K.





________________________________________________________________________
"50 erste Dates" mit Adam Sandler u. Drew Barrymore kostenlos anschauen!
Exklusiv für alle WEB.DE Nutzer. http://www.blockbuster.web.de



More information about the capi-sig mailing list