summarylogtreecommitdiffstats
path: root/python3.9.patch
blob: 266fc190b7ef1e41114451c99c78a228a36d407d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
diff -u --unified --recursive --text /home/raqua/domoticz/src/domoticz-2020.2/hardware/plugins/DelayedLink.h /home/raqua/domoticz2/src/domoticz-2020.2/hardware/plugins/DelayedLink.h
--- ./domoticz-2020.2/hardware/plugins/DelayedLink.h	2020-04-26 15:49:25.000000000 +0200
+++ ./domoticz-2020.2/hardware/plugins/DelayedLink.h	2020-12-05 14:22:49.533604214 +0100
@@ -14,6 +14,17 @@
 #include <frameobject.h>
 #include "../../main/Helper.h"
 
+#ifndef _Py_DEC_REFTOTAL
+  /* _Py_DEC_REFTOTAL macro has been removed from Python 3.9 by:
+    https://github.com/python/cpython/commit/49932fec62c616ec88da52642339d83ae719e924 */
+#  ifdef Py_REF_DEBUG
+#    define _Py_DEC_REFTOTAL _Py_RefTotal--
+#  else
+#    define _Py_DEC_REFTOTAL
+#    define _Py_Dealloc
+#  endif
+#endif
+
 #if PY_VERSION_HEX >= 0x030800f0
 static inline void
 py3__Py_DECREF(const char *filename, int lineno, PyObject *op)
@@ -182,12 +193,14 @@
 			if (!shared_lib_) {
 #ifdef WIN32
 #	ifdef _DEBUG
+				if (!shared_lib_) shared_lib_ = LoadLibrary("python39_d.dll");
 				if (!shared_lib_) shared_lib_ = LoadLibrary("python38_d.dll");
 				if (!shared_lib_) shared_lib_ = LoadLibrary("python37_d.dll");
 				if (!shared_lib_) shared_lib_ = LoadLibrary("python36_d.dll");
 				if (!shared_lib_) shared_lib_ = LoadLibrary("python35_d.dll");
 				if (!shared_lib_) shared_lib_ = LoadLibrary("python34_d.dll");
 #	else
+				if (!shared_lib_) shared_lib_ = LoadLibrary("python39.dll");
 				if (!shared_lib_) shared_lib_ = LoadLibrary("python38.dll");
 				if (!shared_lib_) shared_lib_ = LoadLibrary("python37.dll");
 				if (!shared_lib_) shared_lib_ = LoadLibrary("python36.dll");
@@ -195,6 +208,7 @@
 				if (!shared_lib_) shared_lib_ = LoadLibrary("python34.dll");
 #	endif
 #else
+				if (!shared_lib_) FindLibrary("python3.9", true);
 				if (!shared_lib_) FindLibrary("python3.8", true);
 				if (!shared_lib_) FindLibrary("python3.7", true);
 				if (!shared_lib_) FindLibrary("python3.6", true);