diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-04 21:21:50 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-05 18:16:19 +0100 |
commit | 4feae9674e99027828a41634060c167679e86063 (patch) | |
tree | d0ef2de72bc7ab3ba0b23d0129bd26473fd97ea0 /err.h | |
parent | Fix most memmory errors. (diff) | |
download | calp-4feae9674e99027828a41634060c167679e86063.tar.gz calp-4feae9674e99027828a41634060c167679e86063.tar.xz |
Improve ERR.
Diffstat (limited to '')
-rw-r--r-- | err.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -2,6 +2,10 @@ #define ERR_H #include <stdio.h> -#define ERR(s) fprintf(stderr, "ERR (%s:%i): %s\n", __FILE__, __LINE__, s) +#define RED "\x1B[0;31m" +#define RESET "\x1b[m" +#define ERR(msg) fprintf(stderr, RED "ERR" RESET " (%s:%i) %s\n", __FILE__, __LINE__, #msg) +#define ERR_F(fmt, ...) fprintf(stderr, RED "ERR" RESET " (%s:%i) " fmt "\n", \ + __FILE__, __LINE__, ##__VA_ARGS__) #endif /* ERR_H */ |