diff options
author | mike <mike@FreeBSD.org> | 2001-10-27 19:37:20 +0000 |
---|---|---|
committer | mike <mike@FreeBSD.org> | 2001-10-27 19:37:20 +0000 |
commit | 1521c8f921cdf01bfb300e80469fa86444f2f1c2 (patch) | |
tree | 96632115886f862fc8daf15006dacf822ef3fa97 | |
parent | a298958ff19ad5e4d8416a9623b9d3e0601eefa3 (diff) | |
download | FreeBSD-src-1521c8f921cdf01bfb300e80469fa86444f2f1c2.zip FreeBSD-src-1521c8f921cdf01bfb300e80469fa86444f2f1c2.tar.gz |
Restore K&R prototype. Fix other style bugs.
Reviewed by: asmodai, bde
-rw-r--r-- | include/assert.h | 17 | ||||
-rw-r--r-- | lib/libc/gen/assert.c | 5 |
2 files changed, 12 insertions, 10 deletions
diff --git a/include/assert.h b/include/assert.h index 3c3fea2..19800fd 100644 --- a/include/assert.h +++ b/include/assert.h @@ -39,6 +39,8 @@ * $FreeBSD$ */ +#include <sys/cdefs.h> + /* * Unlike other ANSI header files, <assert.h> may usefully be included * multiple times, with and without NDEBUG defined. @@ -52,17 +54,16 @@ #define _assert(e) ((void)0) #else #define _assert(e) assert(e) + #ifdef __STDC__ #define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \ - __LINE__, #e)) -#else /* PCC */ + __LINE__, #e)) +#else /* !__STDC__ */ #define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \ - __LINE__, "e")) -#endif -#endif - -#include <sys/cdefs.h> + __LINE__, "e")) +#endif /* __STDC__ */ +#endif /* NDEBUG */ __BEGIN_DECLS -void __assert(const char *, const char *, int, const char *); +void __assert __P((const char *, const char *, int, const char *)); __END_DECLS diff --git a/lib/libc/gen/assert.c b/lib/libc/gen/assert.c index 35e096b..9f265b7 100644 --- a/lib/libc/gen/assert.c +++ b/lib/libc/gen/assert.c @@ -46,8 +46,9 @@ __FBSDID("$FreeBSD$"); void __assert(function, file, line, failedexpr) - const char *failedexpr, *file, *function; - int line; + const char *function, *file; + int line; + const char *failedexpr; { (void)fprintf(stderr, "assertion (%s) failed: function %s(), file %s:%d\n", |