xref: /original-bsd/include/assert.h (revision c3e32dec)
1 /*-
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)assert.h	8.1 (Berkeley) 06/02/93
8  */
9 
10 /*
11  * Unlike other ANSI header files, <assert.h> may usefully be included
12  * multiple times, with and without NDEBUG defined.
13  */
14 
15 #undef assert
16 #undef _assert
17 
18 #ifdef NDEBUG
19 #define	assert(e)	((void)0)
20 #define	_assert(e)	((void)0)
21 #else
22 #define	_assert(e)	assert(e)
23 #ifdef __STDC__
24 #define	assert(e)	((e) ? (void)0 : __assert(__FILE__, __LINE__, #e))
25 #else	/* PCC */
26 #define	assert(e)	((e) ? (void)0 : __assert(__FILE__, __LINE__, "e"))
27 #endif
28 #endif
29 
30 #include <sys/cdefs.h>
31 
32 __BEGIN_DECLS
33 void __assert __P((const char *, int, const char *));
34 __END_DECLS
35