[3.13] gh-121700 Emscripten trampolines not quite right since GH-106219 (GH-121701) (GH-121744)

(cherry picked from commit 3086b86cfd)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-07-14 12:37:00 +02:00 committed by GitHub
parent f672ee2242
commit 8f3ffb4156
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -747,13 +747,7 @@ PyAPI_FUNC(PyObject*) _PyObject_GetState(PyObject *);
* Third party code unintentionally rely on problematic fpcasts. The call * Third party code unintentionally rely on problematic fpcasts. The call
* trampoline mitigates common occurrences of bad fpcasts on Emscripten. * trampoline mitigates common occurrences of bad fpcasts on Emscripten.
*/ */
#if defined(__EMSCRIPTEN__) && defined(PY_CALL_TRAMPOLINE) #if !(defined(__EMSCRIPTEN__) && defined(PY_CALL_TRAMPOLINE))
#define _PyCFunction_TrampolineCall(meth, self, args) \
_PyCFunctionWithKeywords_TrampolineCall( \
(*(PyCFunctionWithKeywords)(void(*)(void))(meth)), (self), (args), NULL)
extern PyObject* _PyCFunctionWithKeywords_TrampolineCall(
PyCFunctionWithKeywords meth, PyObject *, PyObject *, PyObject *);
#else
#define _PyCFunction_TrampolineCall(meth, self, args) \ #define _PyCFunction_TrampolineCall(meth, self, args) \
(meth)((self), (args)) (meth)((self), (args))
#define _PyCFunctionWithKeywords_TrampolineCall(meth, self, args, kw) \ #define _PyCFunctionWithKeywords_TrampolineCall(meth, self, args, kw) \