1 From e9bd383ceb63db7cfe8a284014f0cdf8c2bfe4f0 Mon Sep 17 00:00:00 2001
2 From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3 Date: Fri, 1 Nov 2019 10:54:11 +0100
4 Subject: [PATCH] DelayedLink.h: fix build with python 3.8
6 Fix build with python 3.8 by copy/pasting the vim workaround from
7 https://github.com/vim/vim/commit/13a1f3fb0c9d08bba6109fe2131c9524e6ba7e15
11 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
13 hardware/plugins/DelayedLink.h | 38 ++++++++++++++++++++++++++++++++++
14 1 file changed, 38 insertions(+)
16 diff --git a/hardware/plugins/DelayedLink.h b/hardware/plugins/DelayedLink.h
17 index 4bf1973281..c90a7d8e69 100644
18 --- a/hardware/plugins/DelayedLink.h
19 +++ b/hardware/plugins/DelayedLink.h
21 #include <frameobject.h>
22 #include "../../main/Helper.h"
24 +#if PY_VERSION_HEX >= 0x030800f0
26 +py3__Py_DECREF(const char *filename, int lineno, PyObject *op)
28 + (void)filename; /* may be unused, shut up -Wunused-parameter */
29 + (void)lineno; /* may be unused, shut up -Wunused-parameter */
31 + if (--op->ob_refcnt != 0)
34 + if (op->ob_refcnt < 0)
36 + _Py_NegativeRefcount(filename, lineno, op);
47 +#define Py_DECREF(op) py3__Py_DECREF(__FILE__, __LINE__, _PyObject_CAST(op))
50 +py3__Py_XDECREF(PyObject *op)
59 +#define Py_XDECREF(op) py3__Py_XDECREF(_PyObject_CAST(op))