From f83c604ad04341a216d85c151367d6fd1c5416eb Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Tue, 27 Jan 2015 18:07:56 +0100 Subject: [PATCH] add some more messy debug output --- src/fileio.c | 6 ++++++ src/localize.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/fileio.c b/src/fileio.c index ae003a4..55397d7 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -13,6 +13,9 @@ #include "forward.h" #include "fileio.h" #include "tidy.h" +#if !defined(NDEBUG) && defined(_MSC_VER) +#include "sprtf.h" +#endif typedef struct _fp_input_source { @@ -82,6 +85,9 @@ void TIDY_CALL TY_(filesink_putByte)( void* sinkData, byte bv ) { FILE* fout = (FILE*) sinkData; fputc( bv, fout ); +#if !defined(NDEBUG) && defined(_MSC_VER) + SPRTF("%c",bv); +#endif } void TY_(initFileSink)( TidyOutputSink* outp, FILE* fp ) diff --git a/src/localize.c b/src/localize.c index 248c515..bcf0414 100755 --- a/src/localize.c +++ b/src/localize.c @@ -1164,15 +1164,21 @@ void tidy_out( TidyDocImpl* doc, ctmbstr msg, ... ) { ctmbstr cp; enum { sizeBuf=2048 }; - char *buf = TidyDocAlloc(doc,sizeBuf); + char *buf = (char *)TidyDocAlloc(doc,sizeBuf); va_list args; va_start( args, msg ); TY_(tmbvsnprintf)(buf, sizeBuf, msg, args); va_end( args ); +#if !defined(NDEBUG) && defined(_MSC_VER) + add_std_out(0); +#endif for ( cp=buf; *cp; ++cp ) TY_(WriteChar)( *cp, doc->errout ); +#if !defined(NDEBUG) && defined(_MSC_VER) + add_std_out(1); +#endif TidyDocFree(doc, buf); } }