Merge pull request #13 from jjttjj/develop
Support named union members in c-layout
This commit is contained in:
commit
bb4dc5d389
2 changed files with 8 additions and 1 deletions
|
|
@ -2,6 +2,8 @@
|
|||
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
|
||||
|
||||
## [Unreleased]
|
||||
### Added
|
||||
- Add support for named union members in c-layout
|
||||
|
||||
## [1.0.486] - 2024-10-04
|
||||
### Fixed
|
||||
|
|
|
|||
|
|
@ -1149,7 +1149,12 @@
|
|||
|
||||
(defmethod c-layout ::union
|
||||
[[_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
|
||||
(into-array MemoryLayout items))))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue