@@ -254,13 +254,12 @@ PyAPI_FUNC(void) _Py_DecRef(PyObject *);
254254
255255static inline Py_ALWAYS_INLINE void Py_INCREF (PyObject *op)
256256{
257- #if (defined(Py_LIMITED_API) && (Py_LIMITED_API+0 >= 0x030c0000 || defined(Py_REF_DEBUG))) \
258- || defined (_Py_OPAQUE_PYOBJECT)
259- // Stable ABI implements Py_INCREF() as a function call on limited C API
260- // version 3.12 and newer, abi3t, and on Python built in debug mode.
261- // _Py_IncRef() was added to Python 3.10.0a7, use Py_IncRef() on older versions.
262- // Py_IncRef() accepts NULL whereas _Py_IncRef() doesn't.
263- # if Py_LIMITED_API+0 >= 0x030a00A7
257+ #if defined(Py_LIMITED_API) || defined(_Py_OPAQUE_PYOBJECT)
258+ // gh-158401: The stable ABI now implements Py_INCREF() as a function
259+ // call on all limited C API versions. _Py_IncRef() was added to Python
260+ // 3.10.0a7, use Py_IncRef() on older versions. Py_IncRef() accepts NULL,
261+ // whereas _Py_IncRef() doesn't.
262+ # if Py_LIMITED_API+0 >= _Py_PACK_VERSION(3, 10)
264263 _Py_IncRef (op);
265264# else
266265 Py_IncRef (op);
@@ -324,14 +323,13 @@ PyAPI_FUNC(void) _Py_MergeZeroLocalRefcount(PyObject *);
324323#endif // Py_GIL_DISABLED
325324#endif // Py_LIMITED_API
326325
327- #if (defined(Py_LIMITED_API) && (Py_LIMITED_API+0 >= 0x030c0000 || defined(Py_REF_DEBUG))) \
328- || defined (_Py_OPAQUE_PYOBJECT)
329- // Stable ABI implements Py_DECREF() as a function call on limited C API
330- // version 3.12 and newer, abi3t, and on Python built in debug mode.
331- // _Py_DecRef() was added to Python 3.10.0a7, use Py_DecRef() on older versions.
332- // Py_DecRef() accepts NULL whereas _Py_DecRef() doesn't.
326+ #if defined(Py_LIMITED_API) || defined(_Py_OPAQUE_PYOBJECT)
327+ // gh-158401: The stable ABI now implements Py_DECREF() as a function call
328+ // on all limited C API versions. _Py_DecRef() was added to Python 3.10.0a7,
329+ // use Py_DecRef() on older versions. Py_DecRef() accepts NULL, whereas
330+ // _Py_DecRef() doesn't.
333331static inline void Py_DECREF (PyObject *op) {
334- # if Py_LIMITED_API+0 >= 0x030a00A7
332+ # if Py_LIMITED_API+0 >= _Py_PACK_VERSION(3, 10)
335333 _Py_DecRef (op);
336334# else
337335 Py_DecRef (op);
0 commit comments