Fix assert definition

This commit is contained in:
Jeremy Soller
2024-01-03 13:02:51 -07:00
parent 6b88ad6271
commit 2a40638ec3
2 changed files with 6 additions and 5 deletions
+4 -4
View File
@@ -1,5 +1,7 @@
#ifndef _BITS_ASSERT_H
#define _BITS_ASSERT_H
// Do not use include guard, to ensure assert is always defined
#ifdef assert
#undef assert
#endif
#ifdef NDEBUG
# define assert(cond) (void) 0
@@ -7,5 +9,3 @@
# define assert(cond) \
((void)((cond) || (__assert_fail(__func__, __FILE__, __LINE__, #cond), 0)))
#endif
#endif