git.delta.rocks / jrsonnet / refs/commits / 4ea8dc2d6da9

difftreelog

feat(bindings) implement WASM

Лач2020-06-28parent: #85533fe.patch.diff
in: master

3 files changed

modifiedREADME.mddiffbeforeafterboth
--- a/README.md
+++ b/README.md
@@ -20,8 +20,7 @@
 ## Bindings
 
 C bindings (libjsonnet.so) are WIP
-
-Something is implemented, but mostly unusable for now
+JS bindings are WIP too, but also available in WASM form
 
 See them in `./bindings/jsonnet/`
 
modifiedbindings/Makefilediffbeforeafterboth
before · bindings/Makefile
1../target/release/libjsonnet.so:2	cargo build --release -p jsonnet34./c/libjsonnet_test_file: ./c/libjsonnet_test_file.c ../target/release/libjsonnet.so5	gcc -L../target/release/ -ljsonnet ./c/libjsonnet_test_file.c -o ./c/libjsonnet_test_file67.PHONY: test-c8test-c: ./c/libjsonnet_test_file ../target/release/libjsonnet.so9	export LD_LIBRARY_PATH=../target/release/10	ldd ./c/libjsonnet_test_file11	valgrind --leak-check=full ./c/libjsonnet_test_file test.jsonnet12
modifiedbindings/jsonnet/src/lib.rsdiffbeforeafterboth
--- a/bindings/jsonnet/src/lib.rs
+++ b/bindings/jsonnet/src/lib.rs
@@ -17,6 +17,9 @@
 };
 
 #[no_mangle]
+pub extern "C" fn _start() {}
+
+#[no_mangle]
 pub extern "C" fn jsonnet_version() -> &'static [u8; 8] {
 	b"v0.16.0\0"
 }