BAN: Remove #error macros
This commit is contained in:
parent
53ec66ff86
commit
81cb342c12
|
@ -5,5 +5,7 @@
|
||||||
#define ASSERT(cond) do { if (!(cond)) Kernel::panic("ASSERT("#cond") failed"); } while(false)
|
#define ASSERT(cond) do { if (!(cond)) Kernel::panic("ASSERT("#cond") failed"); } while(false)
|
||||||
#define ASSERT_NOT_REACHED() Kernel::panic("ASSERT_NOT_REACHED() failed")
|
#define ASSERT_NOT_REACHED() Kernel::panic("ASSERT_NOT_REACHED() failed")
|
||||||
#else
|
#else
|
||||||
#error "NOT IMPLEMENTED"
|
#include <assert.h>
|
||||||
|
#define ASSERT(cond) assert((cond) && "ASSERT("#cond") failed")
|
||||||
|
#define ASSERT_NOT_REACHED() assert(false && "ASSERT_NOT_REACHED() failed")
|
||||||
#endif
|
#endif
|
|
@ -10,7 +10,7 @@
|
||||||
#include <kernel/Panic.h>
|
#include <kernel/Panic.h>
|
||||||
#define MUST(expr) ({ auto e = expr; if (e.is_error()) Kernel::panic("{}", e.error()); e.release_value(); })
|
#define MUST(expr) ({ auto e = expr; if (e.is_error()) Kernel::panic("{}", e.error()); e.release_value(); })
|
||||||
#else
|
#else
|
||||||
#error "NOT IMPLEMENTED"
|
#define MUST(expr) ({ auto e = expr; assert(!e.is_error()); e.release_value(); })
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TRY(expr) ({ auto e = expr; if (e.is_error()) return e.release_error(); e.release_value(); })
|
#define TRY(expr) ({ auto e = expr; if (e.is_error()) return e.release_error(); e.release_value(); })
|
||||||
|
|
Loading…
Reference in New Issue