My problems occur when TRANSLATE-INTO-FOREIGN-MEMORY is called on an array which is an element of a foreign struct type.
The problem come from :
|
(lisp-array-to-foreign value ptr (unparse-type type))) |
value
is expected to be an array
but it is a SB-SYS:INT-SAP
in my case.
Unfortunately change its definition to:
(defmethod translate-aggregate-to-foreign (ptr value (type foreign-array-type))
(loop for i below (foreign-type-size type)
do (%mem-set (%mem-ref value :char i) ptr :char i)))
Doesn't work.