authorgravatar for luuk@degram.devLuuk de Gram <luuk@degram.dev> 2023-11-01 15:56:30+01:00
committergravatar for luuk@degram.devLuuk de Gram <luuk@degram.dev> 2023-11-03 12:48:53+01:00
log5b2ee5eacc177873ce674a307a1bebdfffeeae10
tree066fbfa957ca31060f8b69e54d72177c410aa8c1
parent938f9dea374193972be05b19b58dced54d79b1cb
signaturelock-open Commit is signed but in an unrecognized format.

docs: update WebAssembly freestanding example


1 files changed, 4 insertions(+), 4 deletions(-)

doc/langref.html.in+4-4
...@@ -11336,12 +11336,12 @@ all your base are belong to us{#end_shell_samp#}...@@ -11336,12 +11336,12 @@ all your base are belong to us{#end_shell_samp#}
11336 {#header_open|WebAssembly#}11336 {#header_open|WebAssembly#}
11337 <p>Zig supports building for WebAssembly out of the box.</p>11337 <p>Zig supports building for WebAssembly out of the box.</p>
11338 {#header_open|Freestanding#}11338 {#header_open|Freestanding#}
11339 <p>For host environments like the web browser and nodejs, build as a dynamic library using the freestanding11339 <p>For host environments like the web browser and nodejs, build as an executable using the freestanding
11340 OS target. Here's an example of running Zig code compiled to WebAssembly with nodejs.</p>11340 OS target. Here's an example of running Zig code compiled to WebAssembly with nodejs.</p>
11341 {#code_begin|lib|math#}11341 {#code_begin|exe|math#}
11342 {#target_wasm#}11342 {#target_wasm#}
11343 {#link_mode_dynamic#}11343 {#additonal_option|-fno-entry#}
11344 {#additonal_option|-rdynamic#}11344 {#additonal_option|--export=add#}
11345extern fn print(i32) void;11345extern fn print(i32) void;
1134611346
11347export fn add(a: i32, b: i32) void {11347export fn add(a: i32, b: i32) void {