From 41675e75f798df1ee0e0bb9cfe3b4f24463bf949 Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Sat, 14 Oct 2017 12:27:19 +0200 Subject: [PATCH] Issue #604 - Remove 'sprtf' code if not ENABLE_DEBUG_LOG --- src/sprtf.c | 3 +++ src/sprtf.h | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/sprtf.c b/src/sprtf.c index d3b936c..3468ac1 100644 --- a/src/sprtf.c +++ b/src/sprtf.c @@ -28,6 +28,8 @@ #include /* for exit() in unix */ #include "sprtf.h" +#ifdef ENABLE_DEBUG_LOG + #ifdef _MSC_VER # ifndef _CRT_SECURE_NO_DEPRECATE # define _CRT_SECURE_NO_DEPRECATE @@ -416,4 +418,5 @@ int MCDECL wsprtf( PTSTR pf, ... ) #endif /* #ifdef UNICODE */ +#endif /* #ifdef ENABLE_DEBUG_LOG */ /* eof - sprtf.c */ diff --git a/src/sprtf.h b/src/sprtf.h index 4cfb6bf..47033f0 100644 --- a/src/sprtf.h +++ b/src/sprtf.h @@ -26,6 +26,7 @@ #ifdef __cplusplus extern "C" { #endif +#ifdef ENABLE_DEBUG_LOG /*============================================================================= * EXTRA Debugging, and information aid. * @@ -51,12 +52,6 @@ extern "C" { # define SPRTF sprtf #endif -#ifdef ENABLE_DEBUG_LOG -# define DEBUG_LOG(ARG) do { ARG; } while(0) -#else -# define DEBUG_LOG(ARG) -#endif - #ifdef _MSC_VER # define MCDECL _cdecl #else @@ -92,9 +87,14 @@ TIDY_EXPORT char *get_date_time_stg(void); TIDY_EXPORT int gettimeofday(struct timeval *tp, void *tzp); #endif +# define DEBUG_LOG(ARG) do { ARG; } while(0) + +#else +# define DEBUG_LOG(ARG) +#endif + #ifdef __cplusplus } #endif - #endif /* #ifndef _SPRTF_HXX_*/ /* eof - sprtf.h */