From 317a08abc64af18c3898f01c7fd34096a193ae39 Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Mon, 20 Sep 2021 14:31:50 -0500 Subject: [PATCH] Add support for serde wrappers to data model --- src/coffi/ffi.clj | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/coffi/ffi.clj b/src/coffi/ffi.clj index 1a79d08..c9808c8 100644 --- a/src/coffi/ffi.clj +++ b/src/coffi/ffi.clj @@ -753,15 +753,25 @@ (defmethod reify-symbolspec :downcall [spec] - (make-downcall (:symbol spec) - (:function/args spec) - (:function/ret spec))) + (cond-> + (make-downcall (:symbol spec) + (:function/args spec) + (:function/ret spec)) + (:function/wrap-serde? spec) + (make-serde-wrapper + (:function/args spec) + (:function/ret spec)))) (defmethod reify-symbolspec :varargs-factory [spec] - (make-varargs-factory (:symbol spec) - (:function/args spec) - (:function/ret spec))) + (cond-> + (make-varargs-factory (:symbol spec) + (:function/args spec) + (:function/ret spec)) + (:function/wrap-serde? spec) + (make-serde-varargs-wrapper + (:function/args spec) + (:function/ret spec)))) (defmethod reify-symbolspec :const [spec]