summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/cython/files/cython-3.0.0_beta3-py312-long.patch')
-rw-r--r--dev-python/cython/files/cython-3.0.0_beta3-py312-long.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/dev-python/cython/files/cython-3.0.0_beta3-py312-long.patch b/dev-python/cython/files/cython-3.0.0_beta3-py312-long.patch
new file mode 100644
index 000000000000..fb849eca8666
--- /dev/null
+++ b/dev-python/cython/files/cython-3.0.0_beta3-py312-long.patch
@@ -0,0 +1,28 @@
+From d82e4e34582e908d315b912a60d81d5759850df5 Mon Sep 17 00:00:00 2001
+From: Stefan Behnel <stefan_ml@behnel.de>
+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
+