From f27e01a039195c379fd6716c4870858789941365 Mon Sep 17 00:00:00 2001 From: Tuowen Zhao Date: Thu, 22 Sep 2016 12:11:16 -0600 Subject: new debug interface --- include/chilldebug.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'include/chilldebug.h') 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 -- cgit v1.2.3-70-g09d2