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.
On Mon, May 14, 2007 at 06:28:13PM +0200, Stelian Ionescu wrote:
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:
sorry, I forgot to actually *attach* the patch :(
Stelian Ionescu sionescu@common-lisp.net writes:
this patch passes the DEREF.*LONG-LONG memory tests(which I ran manually since ECL seems to have some problems in running the tests)
Probably because of this: http://article.gmane.org/gmane.lisp.ecl.general/2794
On Wed, May 16, 2007 at 01:29:24PM +0100, Luis Oliveira wrote:
Stelian Ionescu sionescu@common-lisp.net writes:
this patch passes the DEREF.*LONG-LONG memory tests(which I ran manually since ECL seems to have some problems in running the tests)
Probably because of this: http://article.gmane.org/gmane.lisp.ecl.general/2794
yes, that's it
Hello Stelian,
On 14/05/07, Stelian Ionescu sionescu@common-lisp.net wrote:
Attached there is a patch made against the main branch(not the newtypes one) which adds :UNSIGNED-LONG-LONG and :LONG-LONG to ECL;
I took your patch and moved into the portable side of things so that other Lisps can benefit from this. I've tested it on Lispworks and Allegro and it passes the long-long tests.
- 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.
Yeah, regular functions won't work either. Will add this to the docs.
- 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 haven't tested this with anything other than cffi-tests, but it has a couple of struct tests and they're passing.
You can find the patch here: http://common-lisp.net/~loliveira/tmp/cffi+lotsastuff/
Thanks!