Hi,
I had some time to work on the port of CFFI to ECL and I have attached most of the fixes. They include
+ Fixed the port to architectures without dynamical FFI. (In these ports CFFI foreign function calls only work when lisp code is compiled)
+ ECL supplies its own version of RT hence this need not appear in the ASDF cffi-test.
+ Tests with too large number of arguments (> 34) are marked as expected to fail, since ECL's FFI does not support such function calls.
I had to play a few tricks because CFFI does not allow us to include headers function declarations and ECL cannot rely on the arguments to FOREIGN-FUNCALL which are most of the time bogus. For instance, :string is an alias to :pointer and when you call (foreign-funcall "strlen" :string .. ) we cannot produce a proper C declaration to strlen that does not collide with the one provided by the header <string.h>.
So in the end I end up always using the routine dlsym() to discover the functions and coerce them to a function pointer created with the information given by CFFI. The outcome is therefore much less efficient than what ECL can potentially do.
Regards
Juanjo