This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: [patch] Python 2.4 compatibility.
- From: Tom Tromey <tromey at redhat dot com>
- To: ppluzhnikov at google dot com (Paul Pluzhnikov)
- Cc: archer at sourceware dot org
- Date: Mon, 13 Oct 2008 12:37:06 -0600
- Subject: Re: [patch] Python 2.4 compatibility.
- References: <20081013181729.103A63A6AF3@localhost>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Paul" == Paul Pluzhnikov <ppluzhnikov@google.com> writes:
Paul> Current git source fails to build with python 2.4.
Paul> Attached patch fixes that, but I am not sure that's the best (or
Paul> even correct) fix.
Is the problem that Py_ssize_t is not defined?
Paul> +#if PYTHON_API_VERSION <= 1012
Paul> +typedef int length_t;
Paul> +#else
Paul> +typedef Py_ssize_t length_t;
Paul> +#endif
If so, perhaps this should just conditionally define Py_ssize_t.
If not, I suggest a different typedef name. Names ending in _t are
reserved by POSIX. How about gdbpy_ssize_type?
Paul> +#if PYTHON_API_VERSION <= 1012
Paul> + int iter;
Paul> +#else
Paul> Py_ssize_t iter;
Paul> +#endif
Also if not, I suppose this code should just use the length size.
The fewer conditionals, the better.
Tom