aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-06-14 21:19:42 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-06-14 21:19:42 -0700
commit0bf5420d380a56f8942249f29160c4f9c7a23957 (patch)
tree4492a51f5afd87fe117dd5463b52b1750c5707e2 /system
parente41a6bdf29755b9393dd1d58f03342e8f2a30ffc (diff)
EMSCRIPTEN_KEEPALIVE
Diffstat (limited to 'system')
-rw-r--r--system/include/emscripten.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/system/include/emscripten.h b/system/include/emscripten.h
index 70524835..e265e8fd 100644
--- a/system/include/emscripten.h
+++ b/system/include/emscripten.h
@@ -12,6 +12,16 @@ extern "C" {
#endif
/*
+ * Forces LLVM to not dead-code-eliminate a function. Note that
+ * closure may still eliminate it at the JS level, for which you
+ * should use EXPORTED_FUNCTIONS (see settings.js).
+ *
+ * Example usage:
+ * void EMSCRIPTEN_KEEPALIVE my_function() { .. }
+ */
+#define EMSCRIPTEN_KEEPALIVE __attribute__((used))
+
+/*
* Interface to the underlying JS engine. This function will
* eval() the given script.
*/