aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-10-02 10:51:47 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-10-02 12:12:28 -0700
commit7d47c81e242854f8dbb202af0720c683337de9d0 (patch)
tree0eb9a8da74c4e1a8916e7c6674eea82b011b4ec8 /system
parent808ec53a7dcc7bc0d98e466150de4b3791cc93e6 (diff)
improve emscripten.h for native builds
Diffstat (limited to 'system')
-rw-r--r--system/include/emscripten/emscripten.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/system/include/emscripten/emscripten.h b/system/include/emscripten/emscripten.h
index 8c42a18a..3e69044a 100644
--- a/system/include/emscripten/emscripten.h
+++ b/system/include/emscripten/emscripten.h
@@ -11,6 +11,10 @@
extern "C" {
#endif
+#if !EMSCRIPTEN
+#include <SDL/SDL.h> /* for SDL_Delay in async_call */
+#endif
+
/*
* Forces LLVM to not dead-code-eliminate a function. Note that
* closure may still eliminate it at the JS level, for which you
@@ -43,10 +47,15 @@ extern void emscripten_async_run_script(const char *script, int millis);
* asynchronous callbacks, but you must pause the main
* loop until they complete.
*/
+#if EMSCRIPTEN
extern void emscripten_set_main_loop(void (*func)(), int fps);
extern void emscripten_pause_main_loop();
extern void emscripten_resume_main_loop();
extern void emscripten_cancel_main_loop();
+#else
+#define emscripten_set_main_loop(func, fps) \
+ while (1) func();
+#endif
/*
* Add a function to a queue of events that will execute