diff options
author | B. Stack <bgstack15@gmail.com> | 2022-10-09 17:57:05 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-10-09 17:57:05 -0400 |
commit | a7738f4dc72c9445623cd6f5348d7a80d4e52690 (patch) | |
tree | b336daf9b226783c39e6e985410cecf46484de3d /dbg.h | |
download | fbxkb-a7738f4dc72c9445623cd6f5348d7a80d4e52690.tar.gz fbxkb-a7738f4dc72c9445623cd6f5348d7a80d4e52690.tar.bz2 fbxkb-a7738f4dc72c9445623cd6f5348d7a80d4e52690.zip |
initial commit, straight from apt-get source
Diffstat (limited to 'dbg.h')
-rw-r--r-- | dbg.h | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -0,0 +1,25 @@ +#include <stdio.h> + +#define ERR(fmt, args...) fprintf(stderr, fmt, ## args) +#define DBG2(fmt, args...) fprintf(stderr, "%s:%-5d: " fmt, __FUNCTION__, __LINE__, ## args) +#define ENTER2 do { fprintf(stderr, "%s:%-5d: ENTER\n", __FUNCTION__, __LINE__); } while(0) +#define RET2(args...) do { fprintf(stderr, "%s:%-5d: RETURN\n", __FUNCTION__, __LINE__);\ +return args; } while(0) +#define DBG3(fmt, args...) fprintf(stderr, fmt, ## args) + +#ifdef DEBUG + +#define ENTER do { fprintf(stderr, "%s:%-5d: ENTER\n", __FUNCTION__, __LINE__); } while(0) +#define RET(args...) do { fprintf(stderr, "%s:%-5d: RETURN\n", __FUNCTION__, __LINE__);\ +return args; } while(0) +#define DBG(fmt, args...) fprintf(stderr, "%s:%-5d: " fmt, __FUNCTION__, __LINE__, ## args) + +#else + + +#define ENTER do { } while(0) +#define RET(args...) return args; +#define DBG(fmt, args...) do { } while(0) + +#endif + |