shithub: puzzles

Download patch

ref: 33b3947d1f449335b9065736c76dc74992508cac
parent: e6afc02942ffd4e3738c5a0ac28a14bbbe345ba8
author: Simon Tatham <anakin@pobox.com>
date: Fri Apr 5 11:49:22 EDT 2013

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]

--- a/emcc.c
+++ b/emcc.c
@@ -138,6 +138,16 @@
     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.
  */