@@ -59,7 +59,8 @@ cdef extern from *:
5959 ctypedef struct PyLongObject:
6060 digit* ob_digit
6161
62- void __Pyx_SET_SIZE(object , Py_ssize_t)
62+ cdef extern from " Py_SET_SIZE.h" :
63+ void Py_SET_SIZE(py_long o, Py_ssize_t size)
6364
6465
6566# #######################################################################
@@ -422,8 +423,8 @@ cdef PyLong_FromINT(GEN g):
422423 # Actual correct computed size
423424 cdef Py_ssize_t sizedigits_final = 0
424425
425- x = _PyLong_New(sizedigits)
426- cdef digit* D = ( < PyLongObject * > x) .ob_digit
426+ cdef py_long x = _PyLong_New(sizedigits)
427+ cdef digit* D = x .ob_digit
427428
428429 cdef digit d
429430 cdef ulong w
@@ -452,9 +453,9 @@ cdef PyLong_FromINT(GEN g):
452453
453454 # Set correct size
454455 if signe(g) > 0 :
455- __Pyx_SET_SIZE (x, sizedigits_final)
456+ Py_SET_SIZE (x, sizedigits_final)
456457 else :
457- __Pyx_SET_SIZE (x, - sizedigits_final)
458+ Py_SET_SIZE (x, - sizedigits_final)
458459
459460 return x
460461
@@ -463,8 +464,8 @@ cdef PyLong_FromINT(GEN g):
463464# Conversion Python -> PARI
464465# #######################################################################
465466
466- cdef GEN PyLong_AS_GEN(x):
467- cdef const digit* D = ( < PyLongObject * > x) .ob_digit
467+ cdef GEN PyLong_AS_GEN(py_long x):
468+ cdef const digit* D = x .ob_digit
468469
469470 # Size of the input
470471 cdef size_t sizedigits
0 commit comments