This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[COMMIT] Centralize workaround for Python 2.6's Py_DECREF. (Re: [patch] Compilation regression with python-2.6)
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>, Tom Tromey <tromey at redhat dot com>
- Date: Tue, 21 May 2013 21:54:44 +0100
- Subject: [COMMIT] Centralize workaround for Python 2.6's Py_DECREF. (Re: [patch] Compilation regression with python-2.6)
- References: <87ehe638ww dot fsf at fleche dot redhat dot com> <8761ziy43f dot fsf at fleche dot redhat dot com> <20130521075803 dot GA404 at host2 dot jankratochvil dot net> <519B9B54 dot 9090907 at redhat dot com> <20130521161400 dot GA2763 at host2 dot jankratochvil dot net> <519B9F9A dot 9070600 at redhat dot com>
On 05/21/2013 05:23 PM, Pedro Alves wrote:
> Subject: Centralize workaround for Python 2.6's Py_DECREF.
>
> Wrap/redefine Py_DECREF ourselves, avoiding the need for uses to care
> about extra braces due to the fact that Python only started wrapping Py_DECREF
> in 'do {} while (0)' after 2.6.
>
> gdb/
> 2013-05-21 Pedro Alves <palves@redhat.com>
>
> * python/py-utils.c (py_decref): Remove extra braces.
> (gdb_pymodule_addobject): Remove extra braces.
> * python-internal.h (gdb_Py_DECREF): New static inline function.
> (Py_DECREF): Redefine as calling gdb_Py_DECREF.
I've applied this one.
--
Pedro Alves