d08536ff28
- Add python38-config.patch to make vim buildable with new Python 3.8. (gh#vim/vim#4080) OBS-URL: https://build.opensuse.org/request/show/742141 OBS-URL: https://build.opensuse.org/package/show/editors/vim?expand=0&rev=571
48 lines
938 B
Diff
48 lines
938 B
Diff
--- a/src/if_python3.c
|
|
+++ b/src/if_python3.c
|
|
@@ -600,6 +600,44 @@ static struct
|
|
{"", NULL},
|
|
};
|
|
|
|
+# if PY_VERSION_HEX >= 0x030800f0
|
|
+ static inline void
|
|
+py3__Py_DECREF(const char *filename, int lineno, PyObject *op)
|
|
+{
|
|
+ (void)filename; /* may be unused, shut up -Wunused-parameter */
|
|
+ (void)lineno; /* may be unused, shut up -Wunused-parameter */
|
|
+ _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
|
|
*/
|