This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Python pretty-printing [5/6]
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 7 Apr 2009 11:32:25 -0700
- Subject: Re: Python pretty-printing [5/6]
- References: <m38wmibwq0.fsf@fleche.redhat.com>
> #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