[cffi-devel] [PATCH] emulating LONG-LONG on ECL

Stelian Ionescu sionescu at common-lisp.net
Mon May 14 16:28:13 UTC 2007


Attached there is a patch made against the main branch(not the newtypes
one) which adds :UNSIGNED-LONG-LONG and :LONG-LONG to ECL; to be more specific:

1) it adds a new feature: CFFI:EMULATED-LONG-LONG(not sure this is a
good name - see the callbacks issue below)
2) it calculates at compile time the machine endianess and pushes a new
feature, either :LITTLE-ENDIAN or :BIG-ENDIAN
3) %MEM-REF and %MEM-SET are renamed to %NATIVE-MEM-REF and
%NATIVE-MEM-SET while the new %MEM-REF and %MEM-SET dispatch on the
effective type using CANONICALIZE-FOREIGN-TYPE(which is
forward-referenced but it should be ok)
4) it adds compiler macros for %NATIVE-MEM-REF and %NATIVE-MEM-SET

this patch passes the DEREF.*LONG-LONG memory tests(which I ran manually
since ECL seems to have some problems in running the tests)

two are the problems I've encountered:
1) callbacks don't work since actually ECL doesn't have LONG-LONG. this
can be "fixed" by stating in the docs that on platforms where LONG-LONG
is emulated callback simply don't work.
2) although possibly not related to CFFI, when loading IOLIB-POSIX I got this: 
NIL is not of type REAL.
Broken at CFFI::NOTICE-FOREIGN-STRUCT-DEFINITION.
IOLIB-POSIX>> :backtrace
Backtrace: CFFI::NOTICE-FOREIGN-STRUCT-DEFINITION > eval

I'll investigate further this issue.

-- 
(sign :name "Stelian Ionescu" :aka "fe[nl]ix"
      :quote "Quidquid latine dictum sit, altum videtur.")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20070514/32c1e36a/attachment.sig>


More information about the cffi-devel mailing list