assert.h revision 203964
1214571Sdim/*- 2214571Sdim * Copyright (c) 1992, 1993 3214571Sdim * The Regents of the University of California. All rights reserved. 4214571Sdim * (c) UNIX System Laboratories, Inc. 5214571Sdim * All or some portions of this file are derived from material licensed 6214571Sdim * to the University of California by American Telephone and Telegraph 7214571Sdim * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8214571Sdim * the permission of UNIX System Laboratories, Inc. 9214571Sdim * 10214571Sdim * Redistribution and use in source and binary forms, with or without 11214571Sdim * modification, are permitted provided that the following conditions 12214571Sdim * are met: 13214571Sdim * 1. Redistributions of source code must retain the above copyright 14214571Sdim * notice, this list of conditions and the following disclaimer. 15214571Sdim * 2. Redistributions in binary form must reproduce the above copyright 16214571Sdim * notice, this list of conditions and the following disclaimer in the 17214571Sdim * documentation and/or other materials provided with the distribution. 18214571Sdim * 3. Neither the name of the University nor the names of its contributors 19214571Sdim * may be used to endorse or promote products derived from this software 20214571Sdim * without specific prior written permission. 21214571Sdim * 22214571Sdim * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23214571Sdim * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24214571Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25214571Sdim * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26214571Sdim * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27214571Sdim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28214571Sdim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29214571Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30214571Sdim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31214571Sdim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32214571Sdim * SUCH DAMAGE. 33214571Sdim * 34214571Sdim * @(#)assert.h 8.2 (Berkeley) 1/21/94 35214571Sdim * $FreeBSD: head/include/assert.h 203964 2010-02-16 19:39:50Z imp $ 36214571Sdim */ 37214571Sdim 38214571Sdim#include <sys/cdefs.h> 39214571Sdim 40214571Sdim/* 41214571Sdim * Unlike other ANSI header files, <assert.h> may usefully be included 42214571Sdim * multiple times, with and without NDEBUG defined. 43214571Sdim */ 44214571Sdim 45214571Sdim#undef assert 46214571Sdim#undef _assert 47214571Sdim 48214571Sdim#ifdef NDEBUG 49214571Sdim#define assert(e) ((void)0) 50214571Sdim#define _assert(e) ((void)0) 51214571Sdim#else 52214571Sdim#define _assert(e) assert(e) 53214571Sdim 54214571Sdim#define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \ 55 __LINE__, #e)) 56#endif /* NDEBUG */ 57 58#ifndef _ASSERT_H_ 59#define _ASSERT_H_ 60__BEGIN_DECLS 61void __assert(const char *, const char *, int, const char *); 62__END_DECLS 63#endif /* !_ASSERT_H_ */ 64