add c-layout to struct generation

This commit is contained in:
Kristin Rutenkolk 2024-10-11 15:18:35 +02:00
parent df29b16d71
commit b0cb0f2ff3

View file

@ -1607,9 +1607,18 @@
(partition 2 2)
(map (fn [[hint sym]] (with-meta sym {:tag hint})))
(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
(defrecord ~typename ~typed-symbols)
(defmethod c-layout ~typename [~'_] ~struct-layout)
)
)
)