Make assert more hygienic

This commit is contained in:
Tibor Nagy
2018-10-06 00:12:32 +02:00
parent baddbb98d5
commit 614b2f5103
5 changed files with 37 additions and 14 deletions
+12
View File
@@ -0,0 +1,12 @@
#ifndef _BITS_ASSERT_H
#define _BITS_ASSERT_H
#ifdef NDEBUG
# define assert(cond)
#else
# define assert(cond) if (!(cond)) { \
__assert(__func__, __FILE__, __LINE__, #cond); \
}
#endif
#endif