◐ Shell
reader mode source ↗
Skip to content

bpo-41100: ctypes: use the correct ABI for variadic functions#21242

Closed
lawrence-danna-apple wants to merge 1 commit into
python:masterfrom
lawrence-danna-apple:postback-0005
Closed

bpo-41100: ctypes: use the correct ABI for variadic functions#21242
lawrence-danna-apple wants to merge 1 commit into
python:masterfrom
lawrence-danna-apple:postback-0005

Conversation

@lawrence-danna-apple

@lawrence-danna-apple lawrence-danna-apple commented Jun 30, 2020

Copy link
Copy Markdown
Contributor

On arm64 the calling convention for variardic functions is different
than the convention for fixed-arg functions of the same arg types.

ctypes needs to use ffi_prep_cif_var to tell libffi which calling
convention to use.

https://bugs.python.org/issue41100

On arm64 the calling convention for variardic functions is different
than the convention for fixed-arg functions of the same arg types.

ctypes needs to use ffi_prep_cif_var to tell libffi which calling
convention to use.

This patch adds a new attribute "f.variadic" for ctypes function
pointers, so users can specify which functions are variadic.

It will also auto-detect varargs when a function is called with more
arguments than f.argtypes specifies.   Since this is a new option
and it only matters on arm64 on apple platforms, lots of existing code
will not set f.variadic.   This will do the right thing in most
situations.
@lawrence-danna-apple

Copy link
Copy Markdown
Contributor Author

superseded by #21249

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants