diff options
Diffstat (limited to 'WebInterface/wasm/asm-paint/src/lib.rs')
-rw-r--r-- | WebInterface/wasm/asm-paint/src/lib.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/WebInterface/wasm/asm-paint/src/lib.rs b/WebInterface/wasm/asm-paint/src/lib.rs new file mode 100644 index 0000000..52ddc8f --- /dev/null +++ b/WebInterface/wasm/asm-paint/src/lib.rs @@ -0,0 +1,16 @@ +use wasm_bindgen::prelude::*; + +macro_rules! console_log { + ($($t:tt)*) => (log(&format_args!($($t)*).to_string())) +} + +#[wasm_bindgen] +extern "C" { + #[wasm_bindgen(js_namespace = console)] + fn log(s: &str); +} + +#[wasm_bindgen(start)] +pub fn entry() { + console_log!("hello {} wasm", 42); +} |