mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-02-05 15:10:40 -08:00
ffi: fix size-of-foreign-type when called on structore with no slots
Fixes #752.
This commit is contained in:
parent
f5e3de23fd
commit
4f0fed4698
1 changed files with 9 additions and 8 deletions
|
|
@ -71,14 +71,15 @@ does not include any Lisp storage overhead."
|
|||
((atom type)
|
||||
(error "~A is not a valid foreign type identifier" name))
|
||||
((eq (setf name (first type)) :struct)
|
||||
(setf size (slot-position type nil)
|
||||
align (apply #'max (mapcar #'(lambda (field)
|
||||
(multiple-value-bind (field-size field-align)
|
||||
(size-of-foreign-type (second field))
|
||||
(declare (ignore field-size))
|
||||
field-align))
|
||||
(rest type))))
|
||||
(%align-data size align))
|
||||
(setf size (slot-position type nil))
|
||||
(when (rest type)
|
||||
(setf align (apply #'max (mapcar #'(lambda (field)
|
||||
(multiple-value-bind (field-size field-align)
|
||||
(size-of-foreign-type (second field))
|
||||
(declare (ignore field-size))
|
||||
field-align))
|
||||
(rest type))))
|
||||
(%align-data size align)))
|
||||
((eq name :array)
|
||||
(unless (and (setf size (third type)) (realp size))
|
||||
(error "Incomplete foreign type: ~S" type))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue