On Tue, 2007-05-22 at 18:48 +0800, Chun Tian (binghe) wrote:
**++++ Error in (TOP-LEVEL-FORM 5): Type (SIGNED-BYTE 64) not supported by SYSTEM:TYPED-AREF. ; (TOP-LEVEL-FORM 6) ; *** 1 error detected, no fasl file produced. ;;; Compilation finished with 0 warnings, 1 error.
Is it a bug?
Yes, but it's debatable where the bug is. cffi-sys on LispWorks expects to be able to use fli:foreign-typed-aref for all primitive foreign types (integers, pointers, and floats), and a :long on that platform is 64 bits. That's a reasonable assumption as it seems to work on all other LW setups tested thus far.
Some possible solutions:
1. The Right Thing would be to get LispWorks to support 64-bit integers in foreign-typed-aref, at least on your platform. Maybe this is already done; I don't know what the latest LW release is.
2. The quick and horrible hack is to change all lines like this line in src/cffi-lispworks.lisp
#+#.(cl:if (cl:find-symbol "FOREIGN-TYPED-AREF" "FLI") '(and) '(or))
to this:
#+(or) ;;foreign-typed-aref doesn't really work for me
and remove lines that looks like this:
#-#.(cl:if (cl:find-symbol "FOREIGN-TYPED-AREF" "FLI") '(and) '(or))
Obviously this will only apply on your install.
3. The slightly less horrible hack would be to change the interface of cffi-sys::convert-foreign-typed-aref-type (definition and both uses) to signal an error when the cffi-type argument cannot be so "converted", so the caller can fallback on a less efficient expanded form.