xref: /original-bsd/include/assert.h (revision e0399a72)
1 /*-
2  * Copyright (c) 1990 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)assert.h	4.4 (Berkeley) 04/03/91
8  */
9 
10 #ifndef _ASSERT_H_
11 #define	_ASSERT_H_
12 
13 #ifdef NDEBUG
14 #define	assert
15 #define	_assert
16 #else
17 #define	assert(expression) { \
18 	if (!(expression)) { \
19 		(void)fprintf(stderr, \
20 		    "assertion \"%s\" failed: file \"%s\", line %d\n", \
21 		    "expression", __FILE__, __LINE__); \
22 		exit(2); \
23 	} \
24 }
25 #define	_assert(expression)	assert(expression)
26 #endif
27 
28 #endif /* !_ASSERT_H_ */
29