Refactor error types and error reporting
This commit is contained in:
parent
81b925eea0
commit
a5c4d40575
8 changed files with 137 additions and 147 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue