openzwave: bump to 1.6.1063
[feed/packages.git] / utils / domoticz / patches / 010-python.patch
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
5
6 Fix build with python 3.8 by copy/pasting the vim workaround from
7 https://github.com/vim/vim/commit/13a1f3fb0c9d08bba6109fe2131c9524e6ba7e15
8
9 Fix 3703
10
11 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
12 ---
13 hardware/plugins/DelayedLink.h | 38 ++++++++++++++++++++++++++++++++++
14 1 file changed, 38 insertions(+)
15
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
20 @@ -14,6 +14,44 @@
21 #include <frameobject.h>
22 #include "../../main/Helper.h"
23
24 +#if PY_VERSION_HEX >= 0x030800f0
25 +static inline void
26 +py3__Py_DECREF(const char *filename, int lineno, PyObject *op)
27 +{
28 + (void)filename; /* may be unused, shut up -Wunused-parameter */
29 + (void)lineno; /* may be unused, shut up -Wunused-parameter */
30 + _Py_DEC_REFTOTAL;
31 + if (--op->ob_refcnt != 0)
32 + {
33 +#ifdef Py_REF_DEBUG
34 + if (op->ob_refcnt < 0)
35 + {
36 + _Py_NegativeRefcount(filename, lineno, op);
37 + }
38 +#endif
39 + }
40 + else
41 + {
42 + _Py_Dealloc(op);
43 + }
44 +}
45 +
46 +#undef Py_DECREF
47 +#define Py_DECREF(op) py3__Py_DECREF(__FILE__, __LINE__, _PyObject_CAST(op))
48 +
49 +static inline void
50 +py3__Py_XDECREF(PyObject *op)
51 +{
52 + if (op != NULL)
53 + {
54 + Py_DECREF(op);
55 + }
56 +}
57 +
58 +#undef Py_XDECREF
59 +#define Py_XDECREF(op) py3__Py_XDECREF(_PyObject_CAST(op))
60 +#endif
61 +
62 namespace Plugins {
63
64 #ifdef WIN32