From 2ed39b250788a32ee77e5af1a923edd64211d128 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 20 Apr 2006 15:55:15 +0000 Subject: Macro de debug afin d'eviter de truffer le code de #ifdef DEBUG #endif --- src/ivydebug.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/ivydebug.h (limited to 'src/ivydebug.h') diff --git a/src/ivydebug.h b/src/ivydebug.h new file mode 100644 index 0000000..da1dfee --- /dev/null +++ b/src/ivydebug.h @@ -0,0 +1,20 @@ +#ifndef IVY_DEBUG_H +#define IVY_DEBUG_H + +#ifdef WIN32 +#include +#else +#ifdef DEBUG +#define TRACE(format, args...) \ + fprintf (stderr, format , ## args) + +#define TRACE_IF( cond, format, args...) \ + if ( cond ) fprintf (stderr, format , ## args) + +#else +#define TRACE(format, args...) /**/ +#define TRACE_IF( cond, format, args...) /**/ +#endif +#endif + +#endif -- cgit v1.1 From a09a78c0aee61fcf4ef56477776e85d1f67a0ee6 Mon Sep 17 00:00:00 2001 From: fcolin Date: Fri, 21 Apr 2006 09:38:26 +0000 Subject: portage WIN32 ( pb sur macro debug ) --- src/ivydebug.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/ivydebug.h') diff --git a/src/ivydebug.h b/src/ivydebug.h index da1dfee..749b4ce 100644 --- a/src/ivydebug.h +++ b/src/ivydebug.h @@ -2,7 +2,17 @@ #define IVY_DEBUG_H #ifdef WIN32 -#include +#ifdef DEBUG +#define TRACE(format,...) \ + fprintf (stderr, format , __VA_ARGS__ ) + +#define TRACE_IF( cond, format, ...) \ + if ( cond ) fprintf (stderr, format , __VA_ARGS__ ) + +#else +#define TRACE(format, args...) /**/ +#define TRACE_IF( cond, format, args...) /**/ +#endif #else #ifdef DEBUG #define TRACE(format, args...) \ -- cgit v1.1 From 0887ff3c3e4f655bc1051a56c9e0bcf72398f2f7 Mon Sep 17 00:00:00 2001 From: fcolin Date: Fri, 21 Apr 2006 09:49:17 +0000 Subject: et aussi pour la version sans le DEBUG --- src/ivydebug.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ivydebug.h') diff --git a/src/ivydebug.h b/src/ivydebug.h index 749b4ce..ee73f0e 100644 --- a/src/ivydebug.h +++ b/src/ivydebug.h @@ -10,8 +10,8 @@ if ( cond ) fprintf (stderr, format , __VA_ARGS__ ) #else -#define TRACE(format, args...) /**/ -#define TRACE_IF( cond, format, args...) /**/ +#define TRACE(format, ...) /**/ +#define TRACE_IF( cond, format, ...) /**/ #endif #else #ifdef DEBUG -- cgit v1.1