Files
pandoc/wasm/patches/splitmix.patch
John MacFarlane d86e9ad5df wasm build: Use patches for dependencies...
instead of relying on forks.

The patches themselves are from @TerrorJack's forks of the
corresponding projects.
2026-02-01 14:50:50 +01:00

26 lines
570 B
Diff

--- /dev/null
+++ b/cbits-wasi/init.c
@@ -0,0 +1,8 @@
+#include <stdint.h>
+#include <sys/random.h>
+
+uint64_t splitmix_init() {
+ uint64_t result;
+ int r = getentropy(&result, sizeof(uint64_t));
+ return r == 0 ? result : 0xfeed1000;
+}
--- a/splitmix.cabal
+++ b/splitmix.cabal
@@ -80,7 +80,10 @@ library
frameworks: Security
else
- c-sources: cbits-unix/init.c
+ if arch(wasm32)
+ c-sources: cbits-wasi/init.c
+ else
+ c-sources: cbits-unix/init.c
else
cpp-options: -DSPLITMIX_INIT_COMPAT=1