add c-layout to struct generation
This commit is contained in:
parent
df29b16d71
commit
b0cb0f2ff3
1 changed files with 10 additions and 1 deletions
|
|
@ -1607,9 +1607,18 @@
|
||||||
(partition 2 2)
|
(partition 2 2)
|
||||||
(map (fn [[hint sym]] (with-meta sym {:tag hint})))
|
(map (fn [[hint sym]] (with-meta sym {:tag hint})))
|
||||||
(vec))
|
(vec))
|
||||||
]
|
struct-layout (with-c-layout [::struct
|
||||||
|
(->>
|
||||||
|
members
|
||||||
|
(partition 2 2)
|
||||||
|
(map vec)
|
||||||
|
(map #(update % 0 typename->coffi-typename))
|
||||||
|
(map #(update % 1 keyword))
|
||||||
|
(map reverse)
|
||||||
|
(map vec))])]
|
||||||
`(do
|
`(do
|
||||||
(defrecord ~typename ~typed-symbols)
|
(defrecord ~typename ~typed-symbols)
|
||||||
|
(defmethod c-layout ~typename [~'_] ~struct-layout)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue