DEFCTYPE alias for struct skips type translations
Bug #1924764 reported by
Jan Igger
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
CFFI |
Triaged
|
Medium
|
Unassigned |
Bug Description
This is more a question than a bug probably, but I don't know where else to ask, so why does this work as follows?
```
(cffi:defctype uint8 :unsigned-char)
(cffi:defcstruct (anon-struct-39 :size 16)
(data (:array uint8 16) :offset 0))
(cffi:defctype joystick-guid (:struct anon-struct-39))
(cffi:convert-
(foreign-alloc 'joystick-guid)
'(:struct anon-struct-39))
;; => (DATA #(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0))
(cffi:convert-
(foreign-alloc 'joystick-guid)
'guid)
;; => #.(SB-SYS:INT-SAP #X7FC1E8001950)
```
Why can't I just use 'guid in convert-
To post a comment you must log in.
Sorry, here's a cleaned-up version:
(cffi:defctype uint8 :unsigned-char)
(cffi:defcstruct (anon-struct :size 16)
(data (:array uint8 16) :offset 0))
(cffi:defctype guid (:struct anon-struct))
(cffi:convert- from-foreign
(foreign-alloc 'guid)
'(:struct anon-struct))
;; => (DATA #(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0))
(cffi:convert- from-foreign
(foreign-alloc 'guid)
'guid)
;; => #.(SB-SYS:INT-SAP #X7FC1E8001950)