From 31f2a419764a8ba77c2a970cfc80056c6cd06756 Mon Sep 17 00:00:00 2001 From: shadchin Date: Mon, 12 Feb 2024 07:53:52 +0300 Subject: Update Python from 3.11.8 to 3.12.2 --- contrib/tools/python3/src/Include/cpython/setobject.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'contrib/tools/python3/src/Include/cpython/setobject.h') diff --git a/contrib/tools/python3/src/Include/cpython/setobject.h b/contrib/tools/python3/src/Include/cpython/setobject.h index b4443a678b7..20fd63eaae5 100644 --- a/contrib/tools/python3/src/Include/cpython/setobject.h +++ b/contrib/tools/python3/src/Include/cpython/setobject.h @@ -58,8 +58,13 @@ typedef struct { PyObject *weakreflist; /* List of weak references */ } PySetObject; -#define PySet_GET_SIZE(so) \ - (assert(PyAnySet_Check(so)), (((PySetObject *)(so))->used)) +#define _PySet_CAST(so) \ + (assert(PyAnySet_Check(so)), _Py_CAST(PySetObject*, so)) + +static inline Py_ssize_t PySet_GET_SIZE(PyObject *so) { + return _PySet_CAST(so)->used; +} +#define PySet_GET_SIZE(so) PySet_GET_SIZE(_PyObject_CAST(so)) PyAPI_DATA(PyObject *) _PySet_Dummy; -- cgit v1.3