From 2063898739fecc9fcef9b171754f970e6bbb5a81 Mon Sep 17 00:00:00 2001 From: glenux Date: Mon, 6 Mar 2006 15:17:16 +0000 Subject: [PATCH] --- src/macros.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/macros.h diff --git a/src/macros.h b/src/macros.h new file mode 100644 index 0000000..58bfaf6 --- /dev/null +++ b/src/macros.h @@ -0,0 +1,29 @@ + +#define COLOR_RED "\x1B[31m" +#define COLOR_GREEN "\x1B[32m" +#define COLOR_YELLOW "\x1B[33m" +#define COLOR_NORMAL "\x1B[0m" + + +/************************************************************************** + * * Quelques macros + * */ + +#define pDEBUG(...) if (DEBUG){ \ + printf("%s%s%s at %s:%d -- %s",\ + COLOR_GREEN,\ + __func__,\ + COLOR_NORMAL,\ + __FILE__,\ + __LINE__,\ + COLOR_YELLOW); \ + printf(__VA_ARGS__); \ + printf("%s",COLOR_NORMAL); } + +#define pnDEBUG(...) if (DEBUG){ \ + printf("%s",COLOR_YELLOW); \ + printf(__VA_ARGS__); \ + printf("%s",COLOR_NORMAL); \ + fflush(stdout); } + +