summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-10-23 21:37:25 +0200
committerBram Moolenaar <Bram@vim.org>2019-10-23 21:37:25 +0200
commit13a1f3fb0c9d08bba6109fe2131c9524e6ba7e15 (patch)
tree45401da9d6cbf88c27af9c56dcaa53f6b2388b3f
parent1cac70953d3c012453ea85b1308a8b1f94359c26 (diff)
downloadvim-git-13a1f3fb0c9d08bba6109fe2131c9524e6ba7e15.tar.gz
patch 8.1.2201: cannot build with dynamically linked Python 3.8v8.1.2201
Problem: Cannot build with dynamically linked Python 3.8. Solution: Implement py3__Py_DECREF() and py3__Py_XDECREF(). (Ken Takata, closes #4080)
-rw-r--r--src/if_python3.c36
-rw-r--r--src/version.c2
2 files changed, 38 insertions, 0 deletions
diff --git a/src/if_python3.c b/src/if_python3.c
index b0b11526e..26b973b9c 100644
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -600,6 +600,42 @@ static struct
{"", NULL},
};
+# if PY_VERSION_HEX >= 0x030800f0
+ static inline void
+py3__Py_DECREF(const char *filename UNUSED, int lineno UNUSED, PyObject *op)
+{
+ _Py_DEC_REFTOTAL;
+ if (--op->ob_refcnt != 0)
+ {
+# ifdef Py_REF_DEBUG
+ if (op->ob_refcnt < 0)
+ {
+ _Py_NegativeRefcount(filename, lineno, op);
+ }
+# endif
+ }
+ else
+ {
+ _Py_Dealloc(op);
+ }
+}
+
+# undef Py_DECREF
+# define Py_DECREF(op) py3__Py_DECREF(__FILE__, __LINE__, _PyObject_CAST(op))
+
+ static inline void
+py3__Py_XDECREF(PyObject *op)
+{
+ if (op != NULL)
+ {
+ Py_DECREF(op);
+ }
+}
+
+# undef Py_XDECREF
+# define Py_XDECREF(op) py3__Py_XDECREF(_PyObject_CAST(op))
+# endif
+
/*
* Free python.dll
*/
diff --git a/src/version.c b/src/version.c
index 60a690dec..c2c5584b4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2201,
+/**/
2200,
/**/
2199,