diff options
author | Jakob Kaivo <jkk@ung.org> | 2020-08-16 14:00:51 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2020-08-16 14:00:51 -0400 |
commit | 896e28812c51b9ffdf3efc00c7d7ef699e380a58 (patch) | |
tree | aaa25e093fb4a2ac4c57609e1f745e5ac0734ca8 /src/assert | |
parent | 0b0d1fe1d4fbf8560577d81e5af0549683eac8ba (diff) |
formatting
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); */ |