Skip to content

Commit 6e60430

Browse files
committed
Work around Cython forgetting to include "stdlib.h".
1 parent 3f3c68b commit 6e60430

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/quicktions.pyx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ cdef pow10(long long i):
8282

8383
# Half-private GCD implementation.
8484

85+
cdef extern from "<stdlib.h>":
86+
# Cython <= 3.2.4 bug: llabs requires C99 and stdlib.h, but Cython doesn't include that automatically.
87+
pass
88+
8589
cdef extern from *:
8690
"""
8791
#if defined(__Pyx_PyLong_DigitCount)
@@ -179,7 +183,7 @@ cdef extern from *:
179183
#if Py_LIMITED_API >= 0x030d0000
180184
#define __Quicktions_HAS_FAST_MATH_GCD (1)
181185
#elif Py_LIMITED_API >= 0x030b0000
182-
static int __Quicktions_HAS_FAST_MATH_GCD = (Py_Version >= 0x030d0000);
186+
#define __Quicktions_HAS_FAST_MATH_GCD (Py_Version >= 0x030d0000)
183187
#else
184188
#define __Quicktions_HAS_FAST_MATH_GCD (0)
185189
#endif

0 commit comments

Comments
 (0)