This PR improves support for variadic functions by providing the fixed argument count to jffi. The new jffi, in turn, uses this count to properly set up the FFI context, allowing libffi to properly pass fixed and variadic arguments according to the current platform's ABI.
This PR introduces a new Variadic annotation to specify that a non-varargs Java binding is calling a variadic C function. On platforms where fixed and variadic arguments are passed differently, bindings must either use this annotation or Java varargs so jnr-ffi can determine a proper fixed argument count.
This work has been done primarily to support Apple Silicon, which passes variadic arguments differently than other platforms.
This PR improves support for variadic functions by providing the fixed argument count to jffi. The new jffi, in turn, uses this count to properly set up the FFI context, allowing libffi to properly pass fixed and variadic arguments according to the current platform's ABI.
This PR introduces a new
Variadic
annotation to specify that a non-varargs Java binding is calling a variadic C function. On platforms where fixed and variadic arguments are passed differently, bindings must either use this annotation or Java varargs so jnr-ffi can determine a proper fixed argument count.This work has been done primarily to support Apple Silicon, which passes variadic arguments differently than other platforms.
See https://github.com/jnr/jffi/pull/121