aboutsummaryrefslogtreecommitdiff
path: root/err.h
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-02-04 21:21:50 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-02-05 18:16:19 +0100
commit4feae9674e99027828a41634060c167679e86063 (patch)
treed0ef2de72bc7ab3ba0b23d0129bd26473fd97ea0 /err.h
parentFix most memmory errors. (diff)
downloadcalp-4feae9674e99027828a41634060c167679e86063.tar.gz
calp-4feae9674e99027828a41634060c167679e86063.tar.xz
Improve ERR.
Diffstat (limited to 'err.h')
-rw-r--r--err.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/err.h b/err.h
index d3db805c..5689721b 100644
--- a/err.h
+++ b/err.h
@@ -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 */