Skip to content

Commit e78c891

Browse files
Try to patch mpn_mod_ctx_clear for FLINT
1 parent 80227ae commit e78c891

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From 8b7fbb0598168596b79fec1249874736e3f72395 Mon Sep 17 00:00:00 2001
2+
From: Agriya Khetarpal <[email protected]>
3+
Date: Sun, 25 May 2025 22:05:47 +0530
4+
Subject: [PATCH] Fix signature of `mpn_mod_ctx_clear`
5+
6+
---
7+
src/mpn_mod.h | 2 +-
8+
src/mpn_mod/ring.c | 2 +-
9+
2 files changed, 2 insertions(+), 2 deletions(-)
10+
11+
diff --git a/src/mpn_mod.h b/src/mpn_mod.h
12+
index 3c542195f..f6b02b6d9 100644
13+
--- a/src/mpn_mod.h
14+
+++ b/src/mpn_mod.h
15+
@@ -70,7 +70,7 @@ int _gr_ctx_init_mpn_mod(gr_ctx_t ctx, nn_srcptr n, slong nlimbs);
16+
void gr_ctx_init_mpn_mod_randtest(gr_ctx_t ctx, flint_rand_t state);
17+
18+
int mpn_mod_ctx_write(gr_stream_t out, gr_ctx_t ctx);
19+
-void mpn_mod_ctx_clear(gr_ctx_t ctx);
20+
+int mpn_mod_ctx_clear(gr_ctx_t ctx);
21+
22+
MPN_MOD_INLINE truth_t
23+
mpn_mod_ctx_is_field(gr_ctx_t ctx)
24+
diff --git a/src/mpn_mod/ring.c b/src/mpn_mod/ring.c
25+
index aea80afed..1159d3154 100644
26+
--- a/src/mpn_mod/ring.c
27+
+++ b/src/mpn_mod/ring.c
28+
@@ -30,7 +30,7 @@ mpn_mod_ctx_write(gr_stream_t out, gr_ctx_t ctx)
29+
return GR_SUCCESS;
30+
}
31+
32+
-void
33+
+int
34+
mpn_mod_ctx_clear(gr_ctx_t ctx)
35+
{
36+
flint_free(MPN_MOD_CTX(ctx));
37+
--
38+
2.39.5 (Apple Git-154)
39+

bin/pyodide_build_flint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ tar -xf flint-3.2.2.tar.xz
77

88
cd flint-3.2.2
99

10+
patch -p1 < ../.github/patches/0001-Fix-signature-of-mpn_mod_ctx_clear.patch
11+
1012
emconfigure ./configure \
1113
--disable-dependency-tracking \
1214
--disable-shared \

0 commit comments

Comments
 (0)