Refactor error types and error reporting

This commit is contained in:
Drew Galbraith 2023-06-07 08:50:08 -07:00
parent 81b925eea0
commit a5c4d40575
8 changed files with 137 additions and 147 deletions

View file

@ -2,6 +2,20 @@
#include <stdarg.h>
#include "include/zerrors.h"
void dbg(const char* fmt, ...);
void dbgln(const char* str, ...);
void panic(const char* str, ...);
#define RET_ERR(expr) \
{ \
z_err_t _tmp_err = expr; \
if (_tmp_err != Z_OK) { \
return _tmp_err; \
} \
}
#define UNREACHABLE \
panic("Unreachable %s, %s", __FILE__, __LINE__); \
__builtin_unreachable();