[Ecls-list] More patches for ECL
Juan Jose Garcia-Ripoll
jjgarcia at users.sourceforge.net
Wed Oct 11 20:20:49 UTC 2006
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cffi-ecl-patches.diff
Type: text/x-patch
Size: 11174 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20061011/00c8e163/attachment.bin>
More information about the ecl-devel
mailing list