diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2016-09-22 12:11:16 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2016-09-22 12:11:16 -0600 |
commit | f27e01a039195c379fd6716c4870858789941365 (patch) | |
tree | 86aeeae55bb324400e4e24ab5bab18a80ff6db94 /include/chilldebug.h | |
parent | efda1444166c8d4f8dd7d7b085868f1596b3b9fb (diff) | |
download | chill-f27e01a039195c379fd6716c4870858789941365.tar.gz chill-f27e01a039195c379fd6716c4870858789941365.tar.bz2 chill-f27e01a039195c379fd6716c4870858789941365.zip |
new debug interface
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 |