Skip to content

Commit 2e41220

Browse files
committed
BITS: On x86-64, add the FFI_EFI64 calling convention
As with stdcall on win32, it's the calling convention used when *not* passing FUNCFLAG_CDECL (rather than having an explicit flag of its own).
1 parent 35c3af2 commit 2e41220

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Modules/_ctypes/callbacks.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,9 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
460460
#if defined(MS_WIN32) && !defined(_WIN32_WCE) && !defined(MS_WIN64)
461461
if ((flags & FUNCFLAG_CDECL) == 0)
462462
cc = FFI_STDCALL;
463+
#elif defined(X86_64) && !defined(X86_WIN64)
464+
if ((flags & FUNCFLAG_CDECL) == 0)
465+
cc = FFI_EFI64;
463466
#endif
464467
result = ffi_prep_cif(&p->cif, cc,
465468
Py_SAFE_DOWNCAST(nArgs, Py_ssize_t, int),

Modules/_ctypes/callproc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,9 @@ static int _call_function_pointer(int flags,
799799
#if defined(MS_WIN32) && !defined(MS_WIN64) && !defined(_WIN32_WCE)
800800
if ((flags & FUNCFLAG_CDECL) == 0)
801801
cc = FFI_STDCALL;
802+
#elif defined(X86_64) && !defined(X86_WIN64)
803+
if ((flags & FUNCFLAG_CDECL) == 0)
804+
cc = FFI_EFI64;
802805
#endif
803806
if (FFI_OK != ffi_prep_cif(&cif,
804807
cc,

0 commit comments

Comments
 (0)