expand-to-foreign-dyn ignored when structures are passed by value
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
CFFI |
New
|
Undecided
|
Unassigned |
Bug Description
If structures are passed to/from a structure by value, it falls back to TRANSLATE-
(cffi:define-
()
(:actual-type :pointer)
(:simple-parser a1))
(cffi:defcstruct (a2 :class a2))
(defmethod expand-
`(with-
(setf (cffi:mem-ref ,var a1) ,value)
,@body))
(third (macroexpand-1 '(cffi:defcfun "foo1" :void (a a1))))
;; =>
(DEFUN FOO1 (A)
(WITH-
(SETF (MEM-REF #:G913 A1) A)
(CFFI-
(macroexpand-1 (fourth (third (macroexpand-1 '(cffi:defcfun "foo2" :void (a a1) (b (:struct a2)))))))
;; =>
(CFFI:WITH-
(CFFI:
(CFFI:
(CFFI:
(
(PROGN
(LOOP :FOR CFFI::ARG :IN (LIST #:G643 #:G644)
:FOR
COUNT :FROM 0
:DO (SETF (CFFI:MEM-AREF CFFI::ARGVALUES :POINTER COUNT)
(CFFI::CALL
(VALUES)))))
expected A1 to use WITH-SPECIAL-
tested on sbcl win/linux x8664, cffi v0.15