diff options
Diffstat (limited to 'src/assert')
| -rw-r--r-- | src/assert/__assert.c | 5 | ||||
| -rw-r--r-- | src/assert/assert.c | 20 |
2 files changed, 9 insertions, 16 deletions
diff --git a/src/assert/__assert.c b/src/assert/__assert.c index 630fdec1..22b6108c 100644 --- a/src/assert/__assert.c +++ b/src/assert/__assert.c @@ -1,6 +1,5 @@ -#include <assert.h> -#include "stdio.h" -#include "stdlib.h" +#include <stdio.h> +#include <stdlib.h> void __assert(const char *expr, const char *file, int line, const char *func) { diff --git a/src/assert/assert.c b/src/assert/assert.c index 3a3d2f4f..d49d9800 100644 --- a/src/assert/assert.c +++ b/src/assert/assert.c @@ -1,20 +1,14 @@ -#include <assert.h> - #undef assert #ifdef NDEBUG - -#define assert(__exp) ((void)0) - +# define assert(__exp) ((void)0) #else - -#if __STDC_VERSION__ < 199901L -#define __func__ ((char*)0) -#endif - -#define assert(__exp) \ - ((void)((__exp) || (__assert(#__exp, __FILE__, __LINE__, __func__), 0))) - +# if __STDC_VERSION__ < 199901L +# define __func__ ((char*)0) +# endif +# define assert(__exp) \ + ((void)((__exp) || \ + (__assert(#__exp, __FILE__, __LINE__, __func__), 0))) #endif /* in c89 - void assert(int expression); */ |
