From: Simon Tatham Date: Fri, 5 Apr 2013 15:49:22 +0000 (+0000) Subject: Implement debug_printf() in the Emscripten front end, since that's the X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=33b3947d1f449335b9065736c76dc74992508cac;p=sgt-puzzles.git 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] --- 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. */