Feature or enhancement
ctypes exposes no information about the libffi library it is built with and running on, although libffi mismatches are a common source of platform-specific failures (test_ctypes skips are keyed on platform guesses rather than on the libffi version).
libffi 3.5 added a version API: FFI_VERSION_STRING and FFI_VERSION_NUMBER at compile time, ffi_get_version() and ffi_get_version_number() at runtime. Older versions provide nothing.
Add ctypes.LIBFFI_VERSION and ctypes.LIBFFI_VERSION_INFO for the build-time version, and ctypes.libffi_version and ctypes.libffi_version_info for the runtime version. They are only available if the module was built with libffi 3.5 or later.
Linked PRs
Feature or enhancement
ctypesexposes no information about the libffi library it is built with and running on, although libffi mismatches are a common source of platform-specific failures (test_ctypesskips are keyed on platform guesses rather than on the libffi version).libffi 3.5 added a version API:
FFI_VERSION_STRINGandFFI_VERSION_NUMBERat compile time,ffi_get_version()andffi_get_version_number()at runtime. Older versions provide nothing.Add
ctypes.LIBFFI_VERSIONandctypes.LIBFFI_VERSION_INFOfor the build-time version, andctypes.libffi_versionandctypes.libffi_version_infofor the runtime version. They are only available if the module was built with libffi 3.5 or later.Linked PRs