This is the mail archive of the archer@sourceware.org mailing list for the Archer 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: [patch] Python 2.4 compatibility.


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


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