Skip to content

Commit b871e04

Browse files
Fix __Pyx_IsSameCFunction cast
1 parent a55b647 commit b871e04

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pyodide_build/_f2c_fixes.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ def scipy_fix_cfile(path: Path) -> None:
7676
text = text.replace("void(*)", "int(*)")
7777
text = text.replace("static void f2py_setup_", "static int f2py_setup_")
7878

79+
# Fix Cython-generated function pointer casts for __Pyx_IsSameCFunction
80+
# for _matfuncs_sqrtm
81+
# TODO: not sure if this is the best place to put this, but it works
82+
text = re.sub(
83+
r"(__Pyx_IsSameCFunction\([^,]+,\s*)\(int\(\*\)\(void\)\)",
84+
r"\1(void(*)(void))",
85+
text,
86+
)
87+
7988
if path.name.endswith("_flapackmodule.c"):
8089
text = text.replace(",size_t", "")
8190
text = re.sub(r",slen\([a-z]*\)\)", ")", text)

0 commit comments

Comments
 (0)