Python pretty-printing [5/6]
Joel Brobecker
brobecker@adacore.com
Tue Apr 7 18:32:00 GMT 2009
> #if HAVE_LIBPYTHON2_4
> #include "python2.4/Python.h"
> +#include "python2.4/frameobject.h"
> /* Py_ssize_t is not defined until 2.5.
> Logical type for Py_ssize_t is Py_intptr_t, but that fails in 64-bit
> compilation due to several apparent mistakes in python2.4 API, so we
> @@ -40,8 +41,10 @@
> typedef int Py_ssize_t;
> #elif HAVE_LIBPYTHON2_5
> #include "python2.5/Python.h"
> +#include "python2.5/frameobject.h"
> #elif HAVE_LIBPYTHON2_6
> #include "python2.6/Python.h"
> +#include "python2.6/frameobject.h"
> #else
> #error "Unable to find usable Python.h"
> #endif
Can we avoid this by using the right -I option? It seems to be a shame
that we keep having to include the same file 3 times just because
the file resides in a different directory name...
In other words, do:
#include <Python.h>
instead of:
#if HAVE_LIBPYTHON2_4
#include "python2.4/Python.h"
#elif HAVE_LIBPYTHON2_5
#include "python2.5/Python.h"
#elif HAVE_LIBPYTHON2_6
#include "python2.6/Python.h"
#else
...
#endif
--
Joel
More information about the Gdb-patches
mailing list