From owner-freebsd-arch Fri Dec 15 6: 5:18 2000 From owner-freebsd-arch@FreeBSD.ORG Fri Dec 15 06:05:16 2000 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mail.imp.ch (mail.imp.ch [157.161.1.2]) by hub.freebsd.org (Postfix) with ESMTP id 5E0E837B402 for ; Fri, 15 Dec 2000 06:05:15 -0800 (PST) Received: from levais.imp.ch (levais.imp.ch [157.161.4.66]) by mail.imp.ch (8.11.1/8.11.1) with ESMTP id eBFE5D205100 for ; Fri, 15 Dec 2000 15:05:14 +0100 (CET) (envelope-from Martin.Blapp@imp.ch) Date: Fri, 15 Dec 2000 15:08:48 +0100 (CET) From: Martin Blapp To: arch@freebsd.org Subject: _DIAGASSERT() Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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