From 4e09bca9e34c226b6d7e34b4fa11248405fd988e Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Sun, 22 Oct 2023 19:50:38 +0200 Subject: Move everything into a new repo. --- libc/include/assert.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 libc/include/assert.h (limited to 'libc/include/assert.h') diff --git a/libc/include/assert.h b/libc/include/assert.h new file mode 100644 index 0000000..90a0be4 --- /dev/null +++ b/libc/include/assert.h @@ -0,0 +1,19 @@ +#include +#include + +#define assert(expr) \ + { \ + if (!(expr)) \ + aFailed(__FILE__, __LINE__); \ + } + +#define ASSERT_BUT_FIXME_PROPOGATE(expr) \ + { \ + if (!(expr)) \ + kprintf("Performing assert that should have been a propogated error."); \ + assert(expr); \ + } + +void aFailed(char *f, int l); +#define ASSERT_NOT_REACHED \ + { assert(0) } -- cgit v1.2.3