| 55 | } |
| 56 | |
| 57 | int main(int argc, char const *argv[]) { |
| 58 | // SM shell doesn't implement an event loop and therefore doesn't support |
| 59 | // emscripten_set_main_loop. However, its stdin reads are sync so it |
| 60 | // should exit out after calling main_loop once. |
| 61 | main_loop(); |
| 62 | |
| 63 | #ifdef __EMSCRIPTEN__ |
| 64 | emscripten_set_main_loop(main_loop, 60, 0); |
| 65 | #else |
| 66 | while (1) main_loop(); sleep(1); |
| 67 | #endif |
| 68 | return 0; |
| 69 | } |