diff --git a/console/tidy.c b/console/tidy.c index f72300b..4c1a77e 100644 --- a/console/tidy.c +++ b/console/tidy.c @@ -26,17 +26,12 @@ # include /* Force console to UTF8. */ #endif #if !defined(NDEBUG) && defined(_MSC_VER) -# include "sprtf.h" # ifdef _CRTDBG_MAP_ALLOC # include # include # endif #endif -#ifndef SPRTF -# define SPRTF printf -#endif - /** Tidy will send errors to this file, which will be stderr later. */ static FILE* errout = NULL; diff --git a/include/tidyplatform.h b/include/tidyplatform.h index 19c055c..7ffac19 100644 --- a/include/tidyplatform.h +++ b/include/tidyplatform.h @@ -647,6 +647,20 @@ opaque_type( TidyIterator ); } /* extern "C" */ #endif + +/*============================================================================= + * Debugging + *===========================================================================*/ +#if !defined(NDEBUG) +# include "sprtf.h" +#endif + +#ifndef SPRTF +# define SPRTF printf +#endif + + + #endif /* __TIDY_PLATFORM_H__ */ diff --git a/src/alloc.c b/src/alloc.c index dbfd154..17a1227 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -9,9 +9,6 @@ #include "tidy.h" #include "forward.h" -#ifdef DEBUG_MEMORY -# include "sprtf.h" -#endif static TidyMalloc g_malloc = NULL; static TidyRealloc g_realloc = NULL; diff --git a/src/fileio.c b/src/fileio.c index 52fddc6..da5882e 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -13,9 +13,6 @@ #include "forward.h" #include "fileio.h" #include "tidy.h" -#if !defined(NDEBUG) && defined(_MSC_VER) -# include "sprtf.h" -#endif typedef struct _fp_input_source { diff --git a/src/istack.c b/src/istack.c index bcb09ba..2576407 100644 --- a/src/istack.c +++ b/src/istack.c @@ -10,9 +10,6 @@ #include "attrs.h" #include "streamio.h" #include "tmbstr.h" -#if !defined(NDEBUG) && defined(_MSC_VER) -# include "sprtf.h" -#endif /* duplicate attributes */ AttVal *TY_(DupAttrs)( TidyDocImpl* doc, AttVal *attrs) diff --git a/src/lexer.c b/src/lexer.c index 8eedf60..876d690 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -39,13 +39,6 @@ #include "clean.h" #include "utf8.h" #include "streamio.h" -#ifdef _MSC_VER -# include "sprtf.h" -#endif - -#ifndef SPRTF -# define SPRTF printf -#endif #if !defined(NDEBUG) && defined(_MSC_VER) /* #define DEBUG_ALLOCATION special EXTRA allocation debug information - VERY NOISY */ diff --git a/src/message.c b/src/message.c index ba85387..fd97164 100644 --- a/src/message.c +++ b/src/message.c @@ -14,9 +14,6 @@ #include "streamio.h" #include "tmbstr.h" #include "utf8.h" -#if !defined(NDEBUG) && defined(_MSC_VER) -# include "sprtf.h" -#endif #include "version.h" diff --git a/src/messageobj.c b/src/messageobj.c index 957ef8f..ffdb916 100644 --- a/src/messageobj.c +++ b/src/messageobj.c @@ -10,9 +10,6 @@ #include "tidy-int.h" #include "limits.h" #include "tmbstr.h" -#if !defined(NDEBUG) && defined(_MSC_VER) -# include "sprtf.h" -#endif /********************************************************************* diff --git a/src/parser.c b/src/parser.c index 55430b7..a9db91e 100644 --- a/src/parser.c +++ b/src/parser.c @@ -12,13 +12,6 @@ #include "clean.h" #include "tags.h" #include "tmbstr.h" -#ifdef _MSC_VER -# include "sprtf.h" -#endif - -#ifndef SPRTF -# define SPRTF printf -#endif /* Issue #72 - Need to know to avoid error-reporting - no warning only if --show-body-only yes diff --git a/src/pprint.c b/src/pprint.c index b9c3334..a085463 100644 --- a/src/pprint.c +++ b/src/pprint.c @@ -24,9 +24,6 @@ # ifdef DEBUG_PPRINT extern void dbg_show_node( TidyDocImpl* doc, Node *node, int caller, int indent ); # endif -# ifdef DEBUG_INDENT -# include "sprtf.h" -# endif #endif /* diff --git a/src/sprtf.h b/src/sprtf.h index 14c3e02..c589707 100644 --- a/src/sprtf.h +++ b/src/sprtf.h @@ -62,10 +62,6 @@ TIDY_EXPORT char *get_date_time_stg(); TIDY_EXPORT int gettimeofday(struct timeval *tp, void *tzp); #endif -#ifndef SPRTF -# define SPRTF sprtf -#endif - #ifdef __cplusplus } #endif diff --git a/src/tags.c b/src/tags.c index 4cd50a4..81d67a8 100644 --- a/src/tags.c +++ b/src/tags.c @@ -10,9 +10,6 @@ #include "tidy-int.h" #include "message.h" #include "tmbstr.h" -#if !defined(NDEBUG) && defined(_MSC_VER) -# include "sprtf.h" -#endif /* Attribute checking methods */ static CheckAttribs CheckIMG; static CheckAttribs CheckLINK; diff --git a/src/tidylib.c b/src/tidylib.c index 30c1da6..9befcba 100644 --- a/src/tidylib.c +++ b/src/tidylib.c @@ -34,9 +34,6 @@ #include "mappedio.h" #include "language.h" -#if !defined(NDEBUG) && defined(_MSC_VER) -# include "sprtf.h" -#endif /* Create/Destroy a Tidy "document" object */ static TidyDocImpl* tidyDocCreate( TidyAllocator *allocator );