Skip to content

Commit d357d1f

Browse files
committed
Handle renamed Flint functions
1 parent c39edc0 commit d357d1f

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

src/flint/flintlib/flint.pxd

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,26 @@ cdef extern from "flint/fmpz.h":
3636

3737
ctypedef slong fmpz_struct
3838

39+
cdef extern from *:
40+
"""
41+
/*
42+
* Functions renamed in Flint 3.2.0
43+
*/
44+
#if __FLINT_RELEASE < 30200 /* Flint < 3.2.0 */
45+
46+
#define flint_rand_init flint_randinit
47+
#define flint_rand_clear flint_randclear
48+
49+
#endif
50+
"""
51+
3952
cdef extern from "flint/flint.h":
4053
const char * FLINT_VERSION
4154
const int __FLINT_RELEASE
4255
const int FLINT_BITS
4356
ctypedef void * flint_rand_t
44-
void flint_randinit(flint_rand_t state)
45-
void flint_randclear(flint_rand_t state)
57+
void flint_rand_init(flint_rand_t state)
58+
void flint_rand_clear(flint_rand_t state)
4659
void flint_set_num_threads(long)
4760
long flint_get_num_threads()
4861
void flint_cleanup()

src/flint/pyflint.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ cimport cython
99
from flint.flint_base.flint_context cimport thectx
1010

1111
cdef flint_rand_t global_random_state
12-
flint_randinit(global_random_state)
12+
flint_rand_init(global_random_state)
1313

1414
ctx = thectx

0 commit comments

Comments
 (0)