From 3e09037780ca95633749be3acd52e817eed7f98c Mon Sep 17 00:00:00 2001 From: dzwdz Date: Thu, 24 Aug 2023 19:10:35 +0200 Subject: libc: get most of binutils to compile --- src/libk/include/assert.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/libk/include/assert.h') diff --git a/src/libk/include/assert.h b/src/libk/include/assert.h index 7520aa9..affe1dc 100644 --- a/src/libk/include/assert.h +++ b/src/libk/include/assert.h @@ -1,7 +1,12 @@ #ifdef NDEBUG -#define assert(stmt) do {} while (0) +#define assert(stmt) ((void)0) #else -#define assert(stmt) do { if (!(stmt)) __badassert(__func__, __FILE__, __LINE__); } while (0) +#define assert(stmt) (void)((stmt) || (__badassert(__func__, __FILE__, __LINE__),0)) +#endif + +#ifdef __SPARSE +#undef assert +#define assert(stmt) (0) #endif _Noreturn void __badassert(const char *func, const char *file, int line); -- cgit v1.2.3