diff options
| author | Simon Tatham <anakin@pobox.com> | 2013-04-05 15:49:22 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2013-04-05 15:49:22 +0000 |
| commit | 33b3947d1f449335b9065736c76dc74992508cac (patch) | |
| tree | 3a2454a7c6999a18a453f9bc502bafb8546133f5 | |
| parent | e6afc02942ffd4e3738c5a0ac28a14bbbe345ba8 (diff) | |
| download | puzzles-33b3947d1f449335b9065736c76dc74992508cac.zip puzzles-33b3947d1f449335b9065736c76dc74992508cac.tar.gz puzzles-33b3947d1f449335b9065736c76dc74992508cac.tar.bz2 puzzles-33b3947d1f449335b9065736c76dc74992508cac.tar.xz | |
Implement debug_printf() in the Emscripten front end, since that's the
easiest way to call js_debug with formatted parameters.
[originally from svn r9807]
| -rw-r--r-- | emcc.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -138,6 +138,16 @@ void fatal(char *fmt, ...) js_error_box(buf); } +void debug_printf(char *fmt, ...) +{ + char buf[512]; + va_list ap; + va_start(ap, fmt); + vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + js_debug(buf); +} + /* * HTMLish names for the colours allocated by the puzzle. */ |