From 581c4434de62d9d36392f10e65866c081fb18d71 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Wed, 30 Mar 2022 22:28:33 +0300 Subject: bpo-47162: Add call trampoline to mitigate bad fpcasts on Emscripten (GH-32189) --- Python/importdl.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Python/importdl.h') diff --git a/Python/importdl.h b/Python/importdl.h index 9847652b1f..26d18b626d 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 -- cgit v1.2.1