[cffi-devel] cffi-libffi funcall path and :string

Ryan Pavlik rpavlik at gmail.com
Fri May 18 17:19:30 UTC 2012


For functions using the libffi foreign-funcall path, functions defined
with :string parameters still fail because
TRANSLATE-INTO-FOREIGN-MEMORY is not defined on
FOREIGN-STRING-TYPE.  E.g.,

(defcfun ("xcb_intern_atom" xcb-intern-atom) (:struct xcb-intern-atom-cookie-t)
  (c :pointer)
  (only_if_exists :unsigned-char)
  (name_len :unsigned-short)
  (name :string))

Calling this fails:

There is no applicable method for the generic function
  #<STANDARD-GENERIC-FUNCTION TRANSLATE-INTO-FOREIGN-MEMORY (5)>
when called with arguments
  (#.(SB-SYS:INT-SAP #X7FFFD8000DC0)
   #<CFFI::FOREIGN-STRING-TYPE :UTF-8>
   #.(SB-SYS:INT-SAP #X7FFFECDB7FD8)).
   [Condition of type SIMPLE-ERROR]

This is using unmodified master.

-- 
Ryan Pavlik <rpavlik at gmail.com>
425.220.9585




More information about the cffi-devel mailing list