assert.h revision 1539
1178825Sdfr/*-
2233294Sstas * Copyright (c) 1992, 1993
3233294Sstas *	The Regents of the University of California.  All rights reserved.
4233294Sstas * (c) UNIX System Laboratories, Inc.
5178825Sdfr * All or some portions of this file are derived from material licensed
6233294Sstas * to the University of California by American Telephone and Telegraph
7233294Sstas * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8233294Sstas * the permission of UNIX System Laboratories, Inc.
9178825Sdfr *
10233294Sstas * Redistribution and use in source and binary forms, with or without
11233294Sstas * modification, are permitted provided that the following conditions
12178825Sdfr * are met:
13233294Sstas * 1. Redistributions of source code must retain the above copyright
14233294Sstas *    notice, this list of conditions and the following disclaimer.
15233294Sstas * 2. Redistributions in binary form must reproduce the above copyright
16178825Sdfr *    notice, this list of conditions and the following disclaimer in the
17178825Sdfr *    documentation and/or other materials provided with the distribution.
18178825Sdfr * 3. All advertising materials mentioning features or use of this software
19178825Sdfr *    must display the following acknowledgement:
20178825Sdfr *	This product includes software developed by the University of
21178825Sdfr *	California, Berkeley and its contributors.
22178825Sdfr * 4. Neither the name of the University nor the names of its contributors
23178825Sdfr *    may be used to endorse or promote products derived from this software
24178825Sdfr *    without specific prior written permission.
25178825Sdfr *
26178825Sdfr * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27178825Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28178825Sdfr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29178825Sdfr * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30178825Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31178825Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32178825Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33178825Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34178825Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35178825Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36178825Sdfr * SUCH DAMAGE.
37178825Sdfr *
38178825Sdfr *	@(#)assert.h	8.2 (Berkeley) 1/21/94
39178825Sdfr */
40178825Sdfr
41233294Sstas/*
42178825Sdfr * Unlike other ANSI header files, <assert.h> may usefully be included
43178825Sdfr * multiple times, with and without NDEBUG defined.
44178825Sdfr */
45178825Sdfr
46178825Sdfr#undef assert
47233294Sstas#undef _assert
48178825Sdfr
49178825Sdfr#ifdef NDEBUG
50178825Sdfr#define	assert(e)	((void)0)
51178825Sdfr#define	_assert(e)	((void)0)
52178825Sdfr#else
53178825Sdfr#define	_assert(e)	assert(e)
54178825Sdfr#ifdef __STDC__
55233294Sstas#define	assert(e)	((e) ? (void)0 : __assert(__FILE__, __LINE__, #e))
56233294Sstas#else	/* PCC */
57178825Sdfr#define	assert(e)	((e) ? (void)0 : __assert(__FILE__, __LINE__, "e"))
58178825Sdfr#endif
59178825Sdfr#endif
60178825Sdfr
61178825Sdfr#include <sys/cdefs.h>
62178825Sdfr
63178825Sdfr__BEGIN_DECLS
64178825Sdfrvoid __assert __P((const char *, int, const char *));
65178825Sdfr__END_DECLS
66178825Sdfr