29 lines
821 B
Diff
29 lines
821 B
Diff
--- a/cypari2/convert.pyx
|
|
+++ b/cypari2/convert.pyx
|
|
@@ -59,8 +59,7 @@ cdef extern from *:
|
|
ctypedef struct PyLongObject:
|
|
digit* ob_digit
|
|
|
|
- Py_ssize_t* Py_SIZE_PTR "&Py_SIZE"(object)
|
|
-
|
|
+ void __Pyx_SET_SIZE(object, Py_ssize_t)
|
|
|
|
########################################################################
|
|
# Conversion PARI -> Python
|
|
@@ -450,13 +449,10 @@ cdef PyLong_FromINT(GEN g):
|
|
if d:
|
|
sizedigits_final = i+1
|
|
|
|
- # Set correct size (use a pointer to hack around Cython's
|
|
- # non-support for lvalues).
|
|
- cdef Py_ssize_t* sizeptr = Py_SIZE_PTR(x)
|
|
if signe(g) > 0:
|
|
- sizeptr[0] = sizedigits_final
|
|
+ __Pyx_SET_SIZE(x, sizedigits_final);
|
|
else:
|
|
- sizeptr[0] = -sizedigits_final
|
|
+ __Pyx_SET_SIZE(x, -sizedigits_final);
|
|
|
|
return x
|
|
|