summaryrefslogtreecommitdiff
path: root/include/merror.h
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-09-20 20:46:37 -0400
committerFreya Murphy <freya@freyacat.org>2024-09-20 21:02:38 -0400
commit3b0a87254f8a1e48a155f5571c274297353a0106 (patch)
tree8aab94632c01c50e4adafc8a4d062902d5cdfe4e /include/merror.h
parentremove test file (diff)
downloadmips-3b0a87254f8a1e48a155f5571c274297353a0106.tar.gz
mips-3b0a87254f8a1e48a155f5571c274297353a0106.tar.bz2
mips-3b0a87254f8a1e48a155f5571c274297353a0106.zip
start mld, add loading of object files, add fuzzing support
Diffstat (limited to 'include/merror.h')
-rw-r--r--include/merror.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/merror.h b/include/merror.h
index 727111d..7be6fc7 100644
--- a/include/merror.h
+++ b/include/merror.h
@@ -2,6 +2,8 @@
#ifndef __MERROR_H__
#define __MERROR_H__
+#include <errno.h>
+
/* Error codes
*/
#define M_SUCCESS 0
@@ -34,4 +36,7 @@ void __log_impl(int type, const char *format, ...);
#define ERROR_POS(pos, format, ...) \
__log_impl_pos(pos.y, pos.x, __ERROR, format, ##__VA_ARGS__)
+#define PERROR(format, ...) \
+ __log_impl(__ERROR, format ": %s", ##__VA_ARGS__, (strerror(errno)))
+
#endif /* __MERROR_H__ */