From d82e4e34582e908d315b912a60d81d5759850df5 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 29 May 2023 21:58:15 +0200 Subject: [PATCH] Fix the argument type passed into the new "PyUnstable_Long_Compact*()" C-API functions in CPython 3.12. --- Cython/Utility/TypeConversion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cython/Utility/TypeConversion.c b/Cython/Utility/TypeConversion.c index efc5c1373..09e87d81c 100644 --- a/Cython/Utility/TypeConversion.c +++ b/Cython/Utility/TypeConversion.c @@ -149,8 +149,8 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) - #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact(x) - #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue(x) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) -- 2.41.0