diff --git a/pyodide_build/_f2c_fixes.py b/pyodide_build/_f2c_fixes.py index d66ef823..de5ba4af 100644 --- a/pyodide_build/_f2c_fixes.py +++ b/pyodide_build/_f2c_fixes.py @@ -76,6 +76,15 @@ def scipy_fix_cfile(path: Path) -> None: text = text.replace("void(*)", "int(*)") text = text.replace("static void f2py_setup_", "static int f2py_setup_") + # Fix Cython-generated function pointer casts for __Pyx_IsSameCFunction + # for _matfuncs_sqrtm for builds of SciPy 1.16.0. + # TODO: I'm not sure if this is the best place to put this, but it works + text = re.sub( + r"(__Pyx_IsSameCFunction\([^,]+,\s*)\(int\(\*\)\(void\)\)", + r"\1(void(*)(void))", + text, + ) + if path.name.endswith("_flapackmodule.c"): text = text.replace(",size_t", "") text = re.sub(r",slen\([a-z]*\)\)", ")", text)