[Ecls-list] load-foreign-library

Rick Taube taube at uiuc.edu
Tue Oct 24 18:40:50 UTC 2006


> Again, an integer is printed on screen. So things seem to work. Can  
> you reproduce my steps?


Your version works. But a defcfun will not work that depends on the  
define-foreign-type will not work if the file is loaded from the fasl  
without compiling.  this is the form that breaks when my file is loaded.
  (cffi:defcfun ("c_foo" foo) :int  (when pm-timestamp) )


i think i trigger the same error with this example:

;;;--------------test.lisp
(cffi:define-foreign-type pm-timestamp () ':long)

(ffi:clines "
typedef long PtTimestamp;
int c_foo(PtTimestamp p) {
return (int)p;
}")

(cffi:defcfun ("c_foo" foo) :int  (when pm-timestamp) )
;;;eof



$ ecl -eval '(require :asdf)'
 >(progn  (push "/Lisp/cffi-061012/" asdf:*central-registry*)
        (asdf::oos 'asdf:load-op :cffi)
        (compile-file "test.lisp")
        (load "test")
        )
;;; Loading #P"/Lisp/portmidi/test.fas"
#P"/Lisp/portmidi/test.fas"

 > (foo 1234)
1234
 > ^D

$ ecl -eval '(require :asdf)'
 > (progn (push "/Lisp/cffi-061012/" asdf:*central-registry*)
        (asdf::oos 'asdf:load-op :cffi)
        (load "test")
        )
Unknown CFFI type: PM-TIMESTAMP.
Broken at LOAD.
 >>





More information about the ecl-devel mailing list