convert-from-foreign doesn't translate struct typedefs
Bug #1473506 reported by
3b
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
CFFI |
New
|
Undecided
|
Unassigned |
Bug Description
(cffi:defcstruct foo
(f :unsigned-int))
(cffi:defctype foo (:struct foo))
(cffi:with-
(cffi:
=>
(F 871732)
(cffi:with-
(cffi:
=>
#.(SB-SYS:INT-SAP #X7FFFD68CFFF0)
;; expected (F ...) as with (:struct foo)
tested on sbcl 1.2.13.x, linux/windows x8664, cffi from dec 2014 and a bit past 0.15
To post a comment you must log in.
using ENSURE- PARSED- BASE-TYPE instead of PARSE-TYPE fixes it:
(defun convert- from-foreign (value type) from-foreign value (ensure- parsed- base-type type)))
(translate-
(define- compiler- macro convert- from-foreign (value type) expand- from-foreign value (ensure- parsed- base-type (eval type))) (translate- from-foreign ,value (parse-type ,type))))
(if (constantp type)
(
`
but also breaks some other tests.