[patch] Fix Python 3 build error on 32-bit hosts
Pedro Alves
palves@redhat.com
Wed Feb 4 18:58:00 GMT 2015
On 02/04/2015 06:43 PM, Jan Kratochvil wrote:
> A question is whether the autoconf test isn't an overkill.
I agree with Paul here. I think checking Python version is sufficient.
One could use
> instead just:
> #if PYTHON_ABI_VERSION >= 3
This
https://docs.python.org/3/c-api/object.html#PyObject_Hash
and a quick web search for Py_hash_t seems to indicate that we should
check for Python >=3.2, not just 3.
> Also one could use that #if either just at the valpy_hash() definition or one
> could provide Py_hash_t in gdb/defs.h or one could provide some GDB_Py_hash_t
> in gdb/defs.h.
I'd be fine with providing a fallback Py_hash_t in python/python-internal.h,
where we already do a series of fallback definitions and fixes for older
Python, such as e.g. Py_ssize_t.
Thanks,
Pedro Alves
More information about the Gdb-patches
mailing list