summaryrefslogtreecommitdiff
path: root/include/merror.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-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__ */