From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5298 invoked by alias); 7 Apr 2009 18:32:36 -0000 Received: (qmail 5290 invoked by uid 22791); 7 Apr 2009 18:32:35 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Apr 2009 18:32:29 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id E1B382BAB7B; Tue, 7 Apr 2009 14:32:27 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id XJ5aynYrfjto; Tue, 7 Apr 2009 14:32:27 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id AC1432BAB77; Tue, 7 Apr 2009 14:32:27 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id AD5ABF5A13; Tue, 7 Apr 2009 11:32:25 -0700 (PDT) Date: Tue, 07 Apr 2009 18:32:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: Python pretty-printing [5/6] Message-ID: <20090407183225.GB7535@adacore.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00127.txt.bz2 > #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 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