🎉 Add missing write-u32 helper to mem ns

This commit is contained in:
Andrey Antukh
2025-08-12 16:52:56 +02:00
parent 675864ce0b
commit af02e12685

View File

@@ -110,6 +110,13 @@
(let [target (with-meta target {:tag 'java.nio.ByteBuffer})]
`(.putInt ~target ~offset (unchecked-int ~value)))))
(defmacro write-u32
[target offset value]
(if (:ns &env)
`(.setUint32 ~target ~offset ~value true)
(let [target (with-meta target {:tag 'java.nio.ByteBuffer})]
`(.putInt ~target ~offset (unchecked-int ~value)))))
(defmacro write-i32
"Idiomatic alias for `write-int`"
[target offset value]