assert.h revision 174133
11539Srgrimes/*- 21539Srgrimes * Copyright (c) 1992, 1993 31539Srgrimes * The Regents of the University of California. All rights reserved. 41539Srgrimes * (c) UNIX System Laboratories, Inc. 51539Srgrimes * All or some portions of this file are derived from material licensed 61539Srgrimes * to the University of California by American Telephone and Telegraph 71539Srgrimes * Co. or Unix System Laboratories, Inc. and are reproduced herein with 81539Srgrimes * the permission of UNIX System Laboratories, Inc. 91539Srgrimes * 101539Srgrimes * Redistribution and use in source and binary forms, with or without 111539Srgrimes * modification, are permitted provided that the following conditions 121539Srgrimes * are met: 131539Srgrimes * 1. Redistributions of source code must retain the above copyright 141539Srgrimes * notice, this list of conditions and the following disclaimer. 151539Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 161539Srgrimes * notice, this list of conditions and the following disclaimer in the 171539Srgrimes * documentation and/or other materials provided with the distribution. 181539Srgrimes * 3. All advertising materials mentioning features or use of this software 191539Srgrimes * must display the following acknowledgement: 201539Srgrimes * This product includes software developed by the University of 211539Srgrimes * California, Berkeley and its contributors. 221539Srgrimes * 4. Neither the name of the University nor the names of its contributors 231539Srgrimes * may be used to endorse or promote products derived from this software 241539Srgrimes * without specific prior written permission. 251539Srgrimes * 261539Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 271539Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 281539Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 291539Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 301539Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 311539Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 321539Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 331539Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 341539Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 351539Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 361539Srgrimes * SUCH DAMAGE. 371539Srgrimes * 381539Srgrimes * @(#)assert.h 8.2 (Berkeley) 1/21/94 3985421Sasmodai * $FreeBSD: head/include/assert.h 174133 2007-12-01 19:28:13Z phk $ 401539Srgrimes */ 411539Srgrimes 4285605Smike#include <sys/cdefs.h> 4385605Smike 441539Srgrimes/* 451539Srgrimes * Unlike other ANSI header files, <assert.h> may usefully be included 461539Srgrimes * multiple times, with and without NDEBUG defined. 471539Srgrimes */ 481539Srgrimes 491539Srgrimes#undef assert 501539Srgrimes#undef _assert 511539Srgrimes 521539Srgrimes#ifdef NDEBUG 531539Srgrimes#define assert(e) ((void)0) 541539Srgrimes#define _assert(e) ((void)0) 551539Srgrimes#else 561539Srgrimes#define _assert(e) assert(e) 5785605Smike 5885421Sasmodai#define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \ 5985605Smike __LINE__, #e)) 6085605Smike#endif /* NDEBUG */ 611539Srgrimes 62174133Sphk#ifndef _ASSERT_H_ 63174133Sphk#define _ASSERT_H_ 641539Srgrimes__BEGIN_DECLS 6593032Simpvoid __assert(const char *, const char *, int, const char *); 661539Srgrimes__END_DECLS 67174131Sphk#endif /* !_ASSERT_H_ */ 68