From 7e7c8eb496de2ca575e9ed4318d02904213a85f7 Mon Sep 17 00:00:00 2001 From: millert <> Date: Fri, 13 Jan 2006 17:54:30 +0000 Subject: [PATCH] Include the function name in assert() output. From espie@ --- src/include/assert.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/include/assert.h b/src/include/assert.h index 9c8a5dcc..1246c842 100644 --- a/src/include/assert.h +++ b/src/include/assert.h @@ -1,4 +1,4 @@ -/* $OpenBSD: assert.h,v 1.10 2003/07/15 17:31:18 deraadt Exp $ */ +/* $OpenBSD: assert.h,v 1.11 2006/01/13 17:54:30 millert Exp $ */ /* $NetBSD: assert.h,v 1.6 1994/10/26 00:55:44 cgd Exp $ */ /*- @@ -42,19 +42,23 @@ * multiple times, with and without NDEBUG defined. */ +#include + #undef assert #undef _assert #ifdef NDEBUG -#define assert(e) ((void)0) -#define _assert(e) ((void)0) +# define assert(e) ((void)0) +# define _assert(e) ((void)0) #else -#define _assert(e) assert(e) -#define assert(e) ((e) ? (void)0 : __assert(__FILE__, __LINE__, #e)) +# define _assert(e) assert(e) +# if __ISO_C_VISIBLE >= 1999 +# define assert(e) ((e) ? (void)0 : __assert2(__FILE__, __LINE__, __func__, #e)) +# else +# define assert(e) ((e) ? (void)0 : __assert(__FILE__, __LINE__, #e)) +# endif #endif -#include - __BEGIN_DECLS void __assert(const char *, int, const char *); void __assert2(const char *, int, const char *, const char *);