Skip to content

Commit 41675e7

Browse files
committed
Issue #604 - Remove 'sprtf' code if not ENABLE_DEBUG_LOG
1 parent 3b154dc commit 41675e7

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/sprtf.c

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include <stdlib.h> /* for exit() in unix */
2929
#include "sprtf.h"
3030

31+
#ifdef ENABLE_DEBUG_LOG
32+
3133
#ifdef _MSC_VER
3234
# ifndef _CRT_SECURE_NO_DEPRECATE
3335
# define _CRT_SECURE_NO_DEPRECATE
@@ -416,4 +418,5 @@ int MCDECL wsprtf( PTSTR pf, ... )
416418

417419
#endif /* #ifdef UNICODE */
418420

421+
#endif /* #ifdef ENABLE_DEBUG_LOG */
419422
/* eof - sprtf.c */

src/sprtf.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#ifdef __cplusplus
2727
extern "C" {
2828
#endif
29+
#ifdef ENABLE_DEBUG_LOG
2930
/*=============================================================================
3031
* EXTRA Debugging, and information aid.
3132
*
@@ -51,12 +52,6 @@ extern "C" {
5152
# define SPRTF sprtf
5253
#endif
5354

54-
#ifdef ENABLE_DEBUG_LOG
55-
# define DEBUG_LOG(ARG) do { ARG; } while(0)
56-
#else
57-
# define DEBUG_LOG(ARG)
58-
#endif
59-
6055
#ifdef _MSC_VER
6156
# define MCDECL _cdecl
6257
#else
@@ -92,9 +87,14 @@ TIDY_EXPORT char *get_date_time_stg(void);
9287
TIDY_EXPORT int gettimeofday(struct timeval *tp, void *tzp);
9388
#endif
9489

90+
# define DEBUG_LOG(ARG) do { ARG; } while(0)
91+
92+
#else
93+
# define DEBUG_LOG(ARG)
94+
#endif
95+
9596
#ifdef __cplusplus
9697
}
9798
#endif
98-
9999
#endif /* #ifndef _SPRTF_HXX_*/
100100
/* eof - sprtf.h */

0 commit comments

Comments
 (0)