This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Python pretty-printing [5/6]


>  #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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]