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); } + +