From 5b2ee5eacc177873ce674a307a1bebdfffeeae10 Mon Sep 17 00:00:00 2001 From: Luuk de Gram Date: Wed, 1 Nov 2023 15:56:30 +0100 Subject: [PATCH] docs: update WebAssembly freestanding example --- doc/langref.html.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index b3ae609a75..7e4d25a2fa 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -11336,12 +11336,12 @@ all your base are belong to us{#end_shell_samp#} {#header_open|WebAssembly#}

Zig supports building for WebAssembly out of the box.

{#header_open|Freestanding#} -

For host environments like the web browser and nodejs, build as a dynamic library using the freestanding +

For host environments like the web browser and nodejs, build as an executable using the freestanding OS target. Here's an example of running Zig code compiled to WebAssembly with nodejs.

- {#code_begin|lib|math#} + {#code_begin|exe|math#} {#target_wasm#} - {#link_mode_dynamic#} - {#additonal_option|-rdynamic#} + {#additonal_option|-fno-entry#} + {#additonal_option|--export=add#} extern fn print(i32) void; export fn add(a: i32, b: i32) void {