Skip to content

Commit 3d92fbf

Browse files
committed
Fix build on Windows
1 parent e108c0b commit 3d92fbf

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎pythoncapi_compat.h‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -637,14 +637,15 @@ static inline PyObject* PyImport_AddModuleRef(const char *name)
637637
// gh-105927 added PyWeakref_GetRef() to Python 3.13.0a1
638638
#if (PY_VERSION_HEX < 0x030D0000 \
639639
|| (defined(Py_LIMITED_API) && Py_LIMITED_API+0 < 0x030D0000))
640-
static inline int PyWeakref_GetRef(PyObject *ref, PyObject **pobj)
641-
{
640+
642641
#if defined(Py_LIMITED_API) && Py_LIMITED_API+0 < 0x030D0000 && PY_VERSION_HEX >= 0x030F0000
643-
// Function removed from Python 3.15 C API, but it remains available
644-
// in the stable ABI
645-
PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
642+
// Function removed from Python 3.15 C API, but it remains available
643+
// in the stable ABI
644+
PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
646645
#endif
647646

647+
static inline int PyWeakref_GetRef(PyObject *ref, PyObject **pobj)
648+
{
648649
PyObject *obj;
649650
if (ref != NULL && !PyWeakref_Check(ref)) {
650651
*pobj = NULL;

0 commit comments

Comments
 (0)