diff options
Diffstat (limited to 'include/chilldebug.h')
-rw-r--r-- | include/chilldebug.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/chilldebug.h b/include/chilldebug.h index 8678749..f187955 100644 --- a/include/chilldebug.h +++ b/include/chilldebug.h @@ -1,13 +1,20 @@ - -// a central place to turn on debugging messages - #ifndef DEBUGCHILL_H #define DEBUGCHILL_H +#ifndef NDEBUG // means that CMAKE_BUILD_TYPE=Debug +#define DEBUGCHILL +#endif + #ifdef DEBUGCHILL -#define DEBUG_PRINT(args...) fprintf(stderr, args ) +#define CHILL_DEBUG_PRINT(format,args...) fprintf(stderr,"%s,%s,LN%d:\n\t" format,__FILE__,__FUNCTION__,__LINE__, ##args ) +#define CHILL_DEBUG_BEGIN { \ + fprintf(stderr,"%s,%s,LN%d:\n",__FILE__,__FUNCTION__,__LINE__); +#define CHILL_DEBUG_END } #else -#define DEBUG_PRINT(args...) do {} while(0) /* Don't do anything */ +#define CHILL_DEBUG_PRINT(format,args...) do {} while(0) /* Don't do anything */ +#define CHILL_DEBUG_BEGIN do { +#define CHILL_DEBUG_END } while (0); #endif + #endif |