summaryrefslogtreecommitdiff
path: root/WebInterface/wasm/asm-paint/src/lib.rs
diff options
context:
space:
mode:
authornatrixaeria <janng@gmx.de>2019-05-25 02:06:41 +0200
committernatrixaeria <janng@gmx.de>2019-05-25 02:06:41 +0200
commit90be5f8d63e77ee51256270dec018e2c7448e115 (patch)
tree949159bcdc5cdff23a73f5f03172a17897a87e7c /WebInterface/wasm/asm-paint/src/lib.rs
parent233106ee4fc302579af0224611e55be5b1479f51 (diff)
Resetup webassembly on the cool way
Diffstat (limited to 'WebInterface/wasm/asm-paint/src/lib.rs')
-rw-r--r--WebInterface/wasm/asm-paint/src/lib.rs16
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);
+}