LibC: Make assert() macro a void expression

This commit is contained in:
Bananymous 2024-06-17 16:49:26 +03:00
parent 15f8c7014f
commit d7eb321d58
1 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@
#ifdef NDEBUG #ifdef NDEBUG
#define assert(ignore) ((void)0) #define assert(ignore) ((void)0)
#else #else
#define assert(expr) do { if (!(expr)) __assert_fail(#expr, __FILE__, __LINE__, __func__); } while (0) #define assert(expr) ((expr) ? (void)0 : __assert_fail(#expr, __FILE__, __LINE__, __func__))
#endif #endif
__BEGIN_DECLS __BEGIN_DECLS