summaryrefslogtreecommitdiffstats
path: root/Python/importdl.h
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2022-03-30 19:28:33 (GMT)
committerGitHub <noreply@github.com>2022-03-30 19:28:33 (GMT)
commit581c4434de62d9d36392f10e65866c081fb18d71 (patch)
tree8c7f01b8826e7f11bbe9a344612bb0187e2e4e8e /Python/importdl.h
parent795c00b91cbc208969302e9e16a269c2049af3e9 (diff)
downloadcpython-581c4434de62d9d36392f10e65866c081fb18d71.zip
cpython-581c4434de62d9d36392f10e65866c081fb18d71.tar.gz
cpython-581c4434de62d9d36392f10e65866c081fb18d71.tar.bz2
bpo-47162: Add call trampoline to mitigate bad fpcasts on Emscripten (GH-32189)
Diffstat (limited to 'Python/importdl.h')
-rw-r--r--Python/importdl.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/importdl.h b/Python/importdl.h
index 9847652..26d18b6 100644
--- a/Python/importdl.h
+++ b/Python/importdl.h
@@ -10,6 +10,14 @@ extern const char *_PyImport_DynLoadFiletab[];
extern PyObject *_PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *);
+typedef PyObject *(*PyModInitFunction)(void);
+
+#if defined(__EMSCRIPTEN__) && defined(PY_CALL_TRAMPOLINE)
+extern PyObject *_PyImport_InitFunc_TrampolineCall(PyModInitFunction func);
+#else
+#define _PyImport_InitFunc_TrampolineCall(func) (func)()
+#endif
+
/* Max length of module suffix searched for -- accommodates "module.slb" */
#define MAXSUFFIXSIZE 12