xref: /csrg-svn/include/assert.h (revision 65762)
141438Sbostic /*-
261068Sbostic  * Copyright (c) 1992, 1993
361068Sbostic  *	The Regents of the University of California.  All rights reserved.
4*65762Sbostic  * (c) UNIX System Laboratories, Inc.
5*65762Sbostic  * All or some portions of this file are derived from material licensed
6*65762Sbostic  * to the University of California by American Telephone and Telegraph
7*65762Sbostic  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8*65762Sbostic  * the permission of UNIX System Laboratories, Inc.
941438Sbostic  *
1041438Sbostic  * %sccs.include.redist.c%
1141438Sbostic  *
12*65762Sbostic  *	@(#)assert.h	8.2 (Berkeley) 01/21/94
1341438Sbostic  */
1412179Ssam 
1553251Sbostic /*
1653251Sbostic  * Unlike other ANSI header files, <assert.h> may usefully be included
1753251Sbostic  * multiple times, with and without NDEBUG defined.
1853251Sbostic  */
1947761Sbostic 
2053251Sbostic #undef assert
2156983Storek #undef _assert
2253251Sbostic 
2341438Sbostic #ifdef NDEBUG
2453251Sbostic #define	assert(e)	((void)0)
2554034Sbostic #define	_assert(e)	((void)0)
2641438Sbostic #else
2754034Sbostic #define	_assert(e)	assert(e)
2853251Sbostic #ifdef __STDC__
2953251Sbostic #define	assert(e)	((e) ? (void)0 : __assert(__FILE__, __LINE__, #e))
3053251Sbostic #else	/* PCC */
3153251Sbostic #define	assert(e)	((e) ? (void)0 : __assert(__FILE__, __LINE__, "e"))
3241438Sbostic #endif
3353251Sbostic #endif
3447761Sbostic 
3553251Sbostic #include <sys/cdefs.h>
3653251Sbostic 
3753251Sbostic __BEGIN_DECLS
3853251Sbostic void __assert __P((const char *, int, const char *));
3953251Sbostic __END_DECLS
40