diff options
author | Marvin Borner | 2020-07-29 14:20:12 +0200 |
---|---|---|
committer | Marvin Borner | 2020-07-29 14:20:12 +0200 |
commit | f28c0aae0d8fe6ccd48f3bca711360cb650c4d11 (patch) | |
tree | 12255486f4782bcb1de5e2f35e6bfe7845a0a7df | |
parent | 2218b243897843536c1191f268a91dcb0375d8ac (diff) |
Added assertions
-rw-r--r-- | src/lib/inc/assert.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/inc/assert.h b/src/lib/inc/assert.h new file mode 100644 index 0000000..2cb095b --- /dev/null +++ b/src/lib/inc/assert.h @@ -0,0 +1,11 @@ +// MIT License, Copyright (c) 2020 Marvin Borner + +#ifndef ASSERT_H +#define ASSERT_H + +#include <print.h> + +#define assert(exp) \ + (exp) ? 0 : printf("%s:%d: %s: Assertion '%s' failed\n", __FILE__, __LINE__, __func__, #exp) + +#endif |