xref: /original-bsd/include/assert.h (revision 7a38d872)
1 /*-
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  * (c) UNIX System Laboratories, Inc.
5  * All or some portions of this file are derived from material licensed
6  * to the University of California by American Telephone and Telegraph
7  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8  * the permission of UNIX System Laboratories, Inc.
9  *
10  * %sccs.include.redist.c%
11  *
12  *	@(#)assert.h	8.2 (Berkeley) 01/21/94
13  */
14 
15 /*
16  * Unlike other ANSI header files, <assert.h> may usefully be included
17  * multiple times, with and without NDEBUG defined.
18  */
19 
20 #undef assert
21 #undef _assert
22 
23 #ifdef NDEBUG
24 #define	assert(e)	((void)0)
25 #define	_assert(e)	((void)0)
26 #else
27 #define	_assert(e)	assert(e)
28 #ifdef __STDC__
29 #define	assert(e)	((e) ? (void)0 : __assert(__FILE__, __LINE__, #e))
30 #else	/* PCC */
31 #define	assert(e)	((e) ? (void)0 : __assert(__FILE__, __LINE__, "e"))
32 #endif
33 #endif
34 
35 #include <sys/cdefs.h>
36 
37 __BEGIN_DECLS
38 void __assert __P((const char *, int, const char *));
39 __END_DECLS
40