; compiling (DEFCALLBACK < ...) ; file: /opt/home/simon/lisp_packages/cffi-luis/tests/callbacks.lisp ; in: DEFCALLBACK < ; (CFFI:DEFCALLBACK < ; :INT ; ((CFFI-TESTS::A :POINTER) (CFFI-TESTS::B ; :POINTER)) ; (LET ((CFFI-TESTS::X (CFFI:MEM-REF CFFI-TESTS::A ; :INT)) ; (CFFI-TESTS::Y (CFFI:MEM-REF CFFI-TESTS::B ; :INT))) ; (COND ((> CFFI-TESTS::X CFFI-TESTS::Y) 1) ; ((< CFFI-TESTS::X CFFI-TESTS::Y) -1) ; (T 0)))) ; --> PROGN CFFI-SYS:%DEFCALLBACK SETF LET* LET* MULTIPLE-VALUE-BIND ; LET ; --> ALIEN-SAP SB-ALIEN::ALIEN-LAMBDA ; ==> ; (SB-ALIEN-INTERNALS:ALIEN-CALLBACK ; (FUNCTION INT SYSTEM-AREA-POINTER SYSTEM-AREA-POINTER) ; (LAMBDA (CFFI-TESTS::A CFFI-TESTS::B) ; (CFFI::INVERSE-TRANSLATE-OBJECTS (CFFI-TESTS::A CFFI-TESTS::B) ; (:POINTER :POINTER) ; :INT ; (BLOCK < ; (LET # ; #))))) ; ; caught ERROR: ; (in macroexpansion of (SB-ALIEN-INTERNALS:ALIEN-CALLBACK # #)) ; (hint: For more precise location, try *BREAK-ON-SIGNALS*.) ; Unsupported callback argument type: ; #<ALIEN-SYSTEM-AREA-POINTER-TYPE SB-SYS:SYSTEM-AREA-POINTER>
and
; compiling (DEFCALLBACK READ-INT-FROM-POINTER ...) ; file: /opt/home/simon/lisp_packages/cffi-luis/tests/callbacks.lisp ; in: DEFCALLBACK READ-INT-FROM-POINTER ; (CFFI:DEFCALLBACK CFFI-TESTS::READ-INT-FROM-POINTER ; :VOID ; ((CFFI-TESTS::A :POINTER)) ; (SETQ CFFI-TESTS::*INT* (CFFI:MEM-REF ; CFFI-TESTS::A :INT))) ; --> PROGN CFFI-SYS:%DEFCALLBACK SETF LET* LET* MULTIPLE-VALUE-BIND ; LET ; --> ALIEN-SAP SB-ALIEN::ALIEN-LAMBDA ; ==> ; (SB-ALIEN-INTERNALS:ALIEN-CALLBACK (FUNCTION VOID ; SYSTEM-AREA-POINTER) ; (LAMBDA (CFFI-TESTS::A) ; (CFFI::INVERSE-TRANSLATE-OBJECTS ; (CFFI-TESTS::A) ; (:POINTER) ; :VOID ; (BLOCK ; CFFI-TESTS::READ-INT-FROM-POINTER ; (SETQ CFFI-TESTS::*INT* ; #))))) ; ; caught ERROR: ; (in macroexpansion of (SB-ALIEN-INTERNALS:ALIEN-CALLBACK # #)) ; (hint: For more precise location, try *BREAK-ON-SIGNALS*.) ; cannot use values types here
Andras
Andras Simon asimon@math.bme.hu writes:
; Unsupported callback argument type: ; #<ALIEN-SYSTEM-AREA-POINTER-TYPE SB-SYS:SYSTEM-AREA-POINTER>
Hello,
This SBCL bug has been fixed in SBCL 0.9.5 (oops, I should update the webpage). One callback bug remains though[1].
Thanks for trying CFFI out!
[1] http://article.gmane.org/gmane.lisp.steel-bank.devel/5722
Luis Oliveira luismbo@gmail.com writes:
Andras Simon asimon@math.bme.hu writes:
; Unsupported callback argument type: ; #<ALIEN-SYSTEM-AREA-POINTER-TYPE SB-SYS:SYSTEM-AREA-POINTER>
Hello,
This SBCL bug has been fixed in SBCL 0.9.5 (oops, I should update the webpage). One callback bug remains though[1].
In the meantime I upgraded to cvs sbcl, and I can confirm this. Back to cmucl for the time being...
Thanks for trying CFFI out!
Well, thank _you_ for CFFI! (And Rayiner for Verrazano; I think that the CFFI/Vzn combo is Lisp's best chance to become a first-class citizen in this C-dominated world :)
Andras
[1] http://article.gmane.org/gmane.lisp.steel-bank.devel/5722
-- Luís Oliveira luismbo (@) gmail (.) com Equipa Portuguesa do Translation Project http://www.iro.umontreal.ca/translation/registry.cgi?team=pt
"Luis Oliveira" luismbo@gmail.com writes:
This SBCL bug has been fixed in SBCL 0.9.5 (oops, I should update the webpage). One callback bug remains though[1].
Thanks for trying CFFI out!
That is the void callback bug, no? Is there any progress on this? I would like to try and port lambda-gtk to cffi-sbcl-linux and this is stopping me. Cheers Immanuel
On 10/out/2005, at 10:00, Immanuel Litzroth wrote:
That is the void callback bug, no? Is there any progress on this? I would like to try and port lambda-gtk to cffi-sbcl-linux and this is stopping me.
Yes. There is a work-around:
(eval-when (:compile-toplevel :load-toplevel :execute) (setf sb-alien::*values-type-okay* t))
Put that before declaring the void callbacks.
HTH
"Luis Oliveira" luismbo@gmail.com writes:
On 10/out/2005, at 10:00, Immanuel Litzroth wrote:
That is the void callback bug, no? Is there any progress on this? I would like to try and port lambda-gtk to cffi-sbcl-linux and this is stopping me.
Yes. There is a work-around:
(eval-when (:compile-toplevel :load-toplevel :execute) (setf sb-alien::*values-type-okay* t))
Put that before declaring the void callbacks.
Thanks, I'll try that out. I have another question. Is there no way to support defining lisp types that correspond to aliens in cffi? Is there going to be support for this? Cheers Immanuel
On 13/out/2005, at 10:31, Immanuel Litzroth wrote:
I'll try that out. I have another question. Is there no way to support defining lisp types that correspond to aliens in cffi? Is there going to be support for this?
If I understand correctly, the purpose of this is to avoid run-time allocation of alien structures. (and AFAICT this only applies to CMUCL/SBCL)
Since we don't use such alien types (we only use primitive types), are these deftype's and declarations useful in some other way?
Luis Oliveira luismbo@gmail.com writes:
On 10/out/2005, at 10:00, Immanuel Litzroth wrote:
That is the void callback bug, no? Is there any progress on this? I would like to try and port lambda-gtk to cffi-sbcl-linux and this is stopping me.
Yes. There is a work-around:
(eval-when (:compile-toplevel :load-toplevel :execute) (setf sb-alien::*values-type-okay* t))
Put that before declaring the void callbacks.
There's no need to do that anymore :)
0.9.5.64: Support callbacks with void return types. * Export SB-ALIEN:ALIEN-VOID-TYPE-P * Bind *VALUES-TYPE-OKAY* to T when parsing of the return type * Add test (+ another test for a x86-64 sign extension failure)
CFFI now passes all tests on SBCL Linux/x86.
Andras