Variadic functions, libffi and CType
David Gilbert <[email protected]> Fri, 28 Jan 2011 11:40:33 +0000
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Message-ID | <[email protected]> |
Hi, On one of the ARM ABIs (hard float/VFP) variadic functions are called with a different ABI; my suspicion is that there are other architectures on which libffi's variadic calling doesn't work. I've got a modification that I'll shortly be contributing to libffi to provide a ffi_prep_cif_var to be used with variadic functions where the number of fixed parameters is passed separately from the total number of parameters, and you use ffi_prep_cif_var for variadics but use fii_prep_cif in the normal way for non-variadics. For other architectures ffi_prep_cif_var just does the same as ffi_prep_cif, so the caller doesn't need to care about whether this architecture is special. I'm not a Python user myself, but I noticed that CType uses libffi and the examples include calls to variadic functions, so I wondered what CType people thought of that change and if it would be possible to use it with Python. All thoughts welcome (including others I should ask). Dave ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d