From ebe36e199cc60fba10615dedad27e2a411e1d9bd Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Thu, 23 Sep 2021 12:27:53 -0500 Subject: [PATCH] Update struct definition macro for conformed args --- src/clj/coffi/ffi.clj | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/clj/coffi/ffi.clj b/src/clj/coffi/ffi.clj index 387af8c..a0d7f51 100644 --- a/src/clj/coffi/ffi.clj +++ b/src/clj/coffi/ffi.clj @@ -1166,9 +1166,7 @@ ;; TODO(Joshua): Support adding padding to the structure (and make it ;; extensible?) (let [args (s/conform ::defstruct-args args)] - `(let [struct-type# [::struct [~@(->> (:fields args) - (partition 2) - (map vector))]]] + `(let [struct-type# [::struct ~(mapv (juxt :field-name :field-type) (:fields args))]] (defmethod c-layout ~(:struct-name args) [_type#] (c-layout struct-type#))