Pristine Ack-5.5
[Ack-5.5.git] / lang / cem / libcc.ansi / headers / assert.h
1 /*
2  * assert.h - diagnostics
3  *
4  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
5  * See the copyright notice in the ACK home directory, in the file "Copyright".
6  */
7 /* $Id: assert.h,v 1.5 1994/06/24 11:40:23 ceriel Exp $ */
8
9 void __bad_assertion(const char *_mess);
10
11 #undef  assert
12
13 #define __str(x)        # x
14 #define __xstr(x)       __str(x)
15
16 #if     defined(NDEBUG)
17 #define assert(ignore)  ((void)0)
18 #else
19 #define assert(expr)    ((expr)? (void)0 : \
20                                 __bad_assertion("Assertion \"" #expr \
21                                     "\" failed, file " __xstr(__FILE__) \
22                                     ", line " __xstr(__LINE__) "\n"))
23 #endif  /* NDEBUG */