Skip to content

Commit caaf3ef

Browse files
author
Release Manager
committed
sagemathgh-39291: Workaround to allow flint to be compiled with numpy 2 As discussed in sagemath#39241 . Based on mkoeppe@6247975f786c85c35124a66a 0d32df00260461c5 , but also change the template file. Note that for tests to pass, sagemath#39242 is also needed. URL: sagemath#39291 Reported by: user202729 Reviewer(s): Tobias Diez
2 parents 250d615 + e88cac0 commit caaf3ef

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/sage/libs/flint/flint_wrap.h

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
#pragma push_macro("ulong")
2727
#undef ulong
2828

29+
/* Reserved in C99, needed for FLINT without https://github.com/flintlib/flint/pull/2027 */
30+
#pragma push_macro("I")
31+
#define I Iv
32+
2933
#include <flint/flint.h>
3034

3135
/* If flint was already previously included via another header (e.g.
@@ -169,6 +173,7 @@
169173
#undef mp_bitcnt_t
170174

171175
#pragma pop_macro("ulong")
176+
#pragma pop_macro("I")
172177

173178
/* CPU_SIZE_1 and SIZE_RED_FAILURE_THRESH are defined as macros in flint/fmpz_lll.h
174179
* and as variables in fplll/defs.h, which breaks build if linbox is compiled with fplll */

src/sage_setup/autogen/flint/templates/flint_wrap.h.template

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
#pragma push_macro("ulong")
2727
#undef ulong
2828

29+
/* Reserved in C99, needed for FLINT without https://github.com/flintlib/flint/pull/2027 */
30+
#pragma push_macro("I")
31+
#define I Iv
32+
2933
#include <flint/flint.h>
3034

3135
/* If flint was already previously included via another header (e.g.
@@ -43,6 +47,7 @@
4347
#undef mp_bitcnt_t
4448

4549
#pragma pop_macro("ulong")
50+
#pragma pop_macro("I")
4651

4752
/* CPU_SIZE_1 and SIZE_RED_FAILURE_THRESH are defined as macros in flint/fmpz_lll.h
4853
* and as variables in fplll/defs.h, which breaks build if linbox is compiled with fplll */

0 commit comments

Comments
 (0)