Add support for named union members in c-layout
This commit is contained in:
parent
3fb34923e1
commit
413d231d29
1 changed files with 6 additions and 1 deletions
|
|
@ -1149,7 +1149,12 @@
|
||||||
|
|
||||||
(defmethod c-layout ::union
|
(defmethod c-layout ::union
|
||||||
[[_union types & {:as _opts} :as _type]]
|
[[_union types & {:as _opts} :as _type]]
|
||||||
(let [items (map c-layout types)]
|
(let [items (if (map? types)
|
||||||
|
(map
|
||||||
|
(fn [[field-name field]]
|
||||||
|
(.withName ^MemoryLayout (c-layout field) (name field-name)))
|
||||||
|
types)
|
||||||
|
(map c-layout types))]
|
||||||
(MemoryLayout/unionLayout
|
(MemoryLayout/unionLayout
|
||||||
(into-array MemoryLayout items))))
|
(into-array MemoryLayout items))))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue