aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2013-04-05 15:49:22 +0000
committerSimon Tatham <anakin@pobox.com>2013-04-05 15:49:22 +0000
commit33b3947d1f449335b9065736c76dc74992508cac (patch)
tree3a2454a7c6999a18a453f9bc502bafb8546133f5
parente6afc02942ffd4e3738c5a0ac28a14bbbe345ba8 (diff)
downloadpuzzles-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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/emcc.c b/emcc.c
index 9badcc9..e3bcbf5 100644
--- a/emcc.c
+++ b/emcc.c
@@ -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.
*/