Patch from James H: make the Windows debugging output conditional on

an enabling environment variable.

[originally from svn r8834]
This commit is contained in:
Simon Tatham
2010-01-12 23:32:22 +00:00
parent 7aefa1110a
commit b3af872f3c

View File

@ -154,12 +154,18 @@ void debug_printf(char *fmt, ...)
{ {
char buf[4096]; char buf[4096];
va_list ap; va_list ap;
static int debugging = -1;
if (debugging == -1)
debugging = getenv("DEBUG_PUZZLES") ? 1 : 0;
if (debugging) {
va_start(ap, fmt); va_start(ap, fmt);
_vsnprintf(buf, 4095, fmt, ap); _vsnprintf(buf, 4095, fmt, ap);
dputs(buf); dputs(buf);
va_end(ap); va_end(ap);
} }
}
#endif #endif
#ifndef _WIN32_WCE #ifndef _WIN32_WCE