aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-23 10:29:55 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-23 10:29:55 -0700
commitc03324859da71a65ccc3d1807836d6ea1264714c (patch)
treee4537d79a5de3a1c5830ed2bd8149221d92ef1e5 /system
parent3ea86dea934059a70df28b013a873bad1c733769 (diff)
EM_ASM option for nicer inline assembly
Diffstat (limited to 'system')
-rw-r--r--system/include/emscripten/emscripten.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/system/include/emscripten/emscripten.h b/system/include/emscripten/emscripten.h
index f0df8dca..1ed4c721 100644
--- a/system/include/emscripten/emscripten.h
+++ b/system/include/emscripten/emscripten.h
@@ -19,6 +19,16 @@ extern "C" {
#endif
/*
+ * Convenient syntax for inline assembly/js. Allows stuff like
+ *
+ * EM_ASM(window.alert('hai'));
+ *
+ * Note: double-quotes (") are not supported, but you can use
+ * single-quotes (') in js anyhow.
+ */
+#define EM_ASM(...) asm(#__VA_ARGS__)
+
+/*
* Forces LLVM to not dead-code-eliminate a function. Note that
* you still need to use EXPORTED_FUNCTIONS so it stays alive
* in JS, e.g.