To: vim_dev@googlegroups.com Subject: Patch 8.1.2201 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2201 Problem: Cannot build with dynamically linked Python 3.8. Solution: Implement py3__Py_DECREF() and py3__Py_XDECREF(). (Ken Takata, closes #4080) Files: src/if_python3.c *** ../vim-8.1.2200/src/if_python3.c 2019-05-28 23:08:12.068648696 +0200 --- src/if_python3.c 2019-10-23 21:35:36.067662920 +0200 *************** *** 600,605 **** --- 600,641 ---- {"", 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 */ *** ../vim-8.1.2200/src/version.c 2019-10-22 21:54:28.485327401 +0200 --- src/version.c 2019-10-23 21:37:04.187482489 +0200 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 2201, /**/ -- Mrs Abbott: I'm a paediatrician. Basil: Feet? Mrs Abbott: Children. Sybil: Oh, Basil! Basil: Well, children have feet, don't they? That's how they move around, my dear. You must take a look next time, it's most interesting. (Fawlty Towers) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///