Make the debugging macros expand to (void)0 instead of simply nothing

when debugging is turned off.
Rename debugging functions due to namespace violation.

MFC after:	1 week
This commit is contained in:
Dag-Erling Smørgrav 2009-06-13 00:13:44 +00:00
parent 7455b100af
commit 570706f8ad
2 changed files with 36 additions and 36 deletions

View File

@ -35,7 +35,7 @@ static int trace_level = 0;
static int trace_level_bk = 0;
void
__trace_in(const char *s, const char *f, int l)
nscd_trace_in(const char *s, const char *f, int l)
{
int i;
if (trace_level < TRACE_WANTED)
@ -50,7 +50,7 @@ __trace_in(const char *s, const char *f, int l)
}
void
__trace_point(const char *f, int l)
nscd_trace_point(const char *f, int l)
{
int i;
@ -64,7 +64,7 @@ __trace_point(const char *f, int l)
}
void
__trace_msg(const char *msg, const char *f, int l)
nscd_trace_msg(const char *msg, const char *f, int l)
{
int i;
@ -78,7 +78,7 @@ __trace_msg(const char *msg, const char *f, int l)
}
void
__trace_ptr(const char *desc, const void *p, const char *f, int l)
nscd_trace_ptr(const char *desc, const void *p, const char *f, int l)
{
int i;
@ -92,7 +92,7 @@ __trace_ptr(const char *desc, const void *p, const char *f, int l)
}
void
__trace_int(const char *desc, int i, const char *f, int l)
nscd_trace_int(const char *desc, int i, const char *f, int l)
{
int j;
@ -106,7 +106,7 @@ __trace_int(const char *desc, int i, const char *f, int l)
}
void
__trace_str(const char *desc, const char *s, const char *f, int l)
nscd_trace_str(const char *desc, const char *s, const char *f, int l)
{
int i;
@ -120,7 +120,7 @@ __trace_str(const char *desc, const char *s, const char *f, int l)
}
void
__trace_out(const char *s, const char *f, int l)
nscd_trace_out(const char *s, const char *f, int l)
{
int i;
@ -135,14 +135,14 @@ __trace_out(const char *s, const char *f, int l)
}
void
__trace_on(void)
nscd_trace_on(void)
{
trace_level = trace_level_bk;
trace_level_bk = 0;
}
void
__trace_off(void)
nscd_trace_off(void)
{
trace_level_bk = trace_level;
trace_level = 1024;

View File

@ -33,35 +33,35 @@
/* #ifndef NDEBUG */
#if 0
#define TRACE_IN(x) __trace_in(#x, __FILE__, __LINE__)
#define TRACE_POINT() __trace_point(__FILE__, __LINE__)
#define TRACE_MSG(x) __trace_msg(x, __FILE__, __LINE__)
#define TRACE_PTR(p) __trace_ptr(#p, p, __FILE__, __LINE__)
#define TRACE_INT(i) __trace_int(#i, i, __FILE__, __LINE__)
#define TRACE_STR(s) __trace_str(#s, s, __FILE__, __LINE__)
#define TRACE_OUT(x) __trace_out(#x, __FILE__, __LINE__)
#define TRACE_ON() __trace_on()
#define TRACE_OFF() __trace_off()
#define TRACE_IN(x) nscd_trace_in(#x, __FILE__, __LINE__)
#define TRACE_POINT() nscd_trace_point(__FILE__, __LINE__)
#define TRACE_MSG(x) nscd_trace_msg(x, __FILE__, __LINE__)
#define TRACE_PTR(p) nscd_trace_ptr(#p, p, __FILE__, __LINE__)
#define TRACE_INT(i) nscd_trace_int(#i, i, __FILE__, __LINE__)
#define TRACE_STR(s) nscd_trace_str(#s, s, __FILE__, __LINE__)
#define TRACE_OUT(x) nscd_trace_out(#x, __FILE__, __LINE__)
#define TRACE_ON() nscd_trace_on()
#define TRACE_OFF() nscd_trace_off()
#else
#define TRACE_IN(x)
#define TRACE_POINT()
#define TRACE_MSG(x)
#define TRACE_PTR(p)
#define TRACE_INT(i)
#define TRACE_STR(s)
#define TRACE_OUT(x)
#define TRACE_ON()
#define TRACE_OFF()
#define TRACE_IN(x) (void)0
#define TRACE_POINT() (void)0
#define TRACE_MSG(x) (void)0
#define TRACE_PTR(p) (void)0
#define TRACE_INT(i) (void)0
#define TRACE_STR(s) (void)0
#define TRACE_OUT(x) (void)0
#define TRACE_ON() (void)0
#define TRACE_OFF() (void)0
#endif
extern void __trace_in(const char *, const char *, int);
extern void __trace_point(const char *, int);
extern void __trace_msg(const char *, const char *, int);
extern void __trace_ptr(const char *, const void *, const char *, int);
extern void __trace_int(const char *, int, const char *, int);
extern void __trace_str(const char *, const char *, const char *, int);
extern void __trace_out(const char *, const char *, int);
extern void __trace_on(void);
extern void __trace_off(void);
extern void nscd_trace_in(const char *, const char *, int);
extern void nscd_trace_point(const char *, int);
extern void nscd_trace_msg(const char *, const char *, int);
extern void nscd_trace_ptr(const char *, const void *, const char *, int);
extern void nscd_trace_int(const char *, int, const char *, int);
extern void nscd_trace_str(const char *, const char *, const char *, int);
extern void nscd_trace_out(const char *, const char *, int);
extern void nscd_trace_on(void);
extern void nscd_trace_off(void);
#endif