From 22a70eb5b226b92f8ce2682c2ba4067f9599767d Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 9 Jul 2025 11:13:25 +0200 Subject: [PATCH] :tada: Add write-bool helper to buffer ns helpers --- common/src/app/common/buffer.cljc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/src/app/common/buffer.cljc b/common/src/app/common/buffer.cljc index 390f3ffbf3..74514a3951 100644 --- a/common/src/app/common/buffer.cljc +++ b/common/src/app/common/buffer.cljc @@ -74,6 +74,13 @@ (let [target (with-meta target {:tag 'java.nio.ByteBuffer})] `(.put ~target ~offset (unchecked-byte ~value))))) +(defmacro write-bool + [target offset value] + (if (:ns &env) + `(.setInt8 ~target ~offset (if ~value 0x01 0x00) true) + (let [target (with-meta target {:tag 'java.nio.ByteBuffer})] + `(.put ~target ~offset (unchecked-byte (if ~value 0x01 0x00)))))) + (defmacro write-short [target offset value] (if (:ns &env)