Date: Fri, 15 Dec 2000 15:08:48 +0100 (CET) From: Martin Blapp <mb@imp.ch> To: arch@freebsd.org Subject: _DIAGASSERT() Message-ID: <Pine.BSF.4.21.0012151505110.10655-100000@levais.imp.ch>
next in thread | raw e-mail | index | archive | help
Hi,
I'm porting code from NetBSD and ask myself if I should remove
some userland-code _DIAGASSERT()'s ...
There is nothing appropriate in FreeBSD like diagassert() ...
In NetBSD this is defined therefore :
include/assert.h:# define _DIAGASSERT(e) ((e) ? (void)0
: __diagassert(__FILE__, __LINE__, "e"))
and in libc/gen/assert.c :
void
__diagassert(file, line, failedexpr)
const char *file, *failedexpr;
int line;
{
/*
* XXX: check $DIAGASSERT here, and do user-defined
actions
*/
(void)fprintf(stderr,
"%s: assertion \"%s\" failed: file \"%s\", line %d\n",
__progname, failedexpr, file, line);
syslog(LOG_DEBUG|LOG_USER,
"assertion \"%s\" failed: file \"%s\", line %d",
failedexpr, file, line);
return;
}
Cheers
Martin
Martin Blapp, mb@imp.ch
------------------------------------------------
Improware AG, UNIX solution and service provider
Zurlindenstrasse 29, 4133 Pratteln, Switzerland
Phone: +41 79 370 26 05, Fax: +41 61 826 93 01
------------------------------------------------
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0012151505110.10655-100000>
