Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed

Commits on Jul 1, 2020

  1. ctypes: use the correct ABI for variadic functions

    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 committed Jul 1, 2020
    Configuration menu
    Copy the full SHA
    fc54fcb View commit details
    Browse the repository at this point in the history