Pristine Ack-5.5
[Ack-5.5.git] / include / _tail_cc / assert.h
1 /*
2  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3  * See the copyright notice in the ACK home directory, in the file "Copyright".
4  */
5 /* $Id: assert.h,v 1.5 1994/06/24 11:05:08 ceriel Exp $ */
6 /*       A S S E R T I O N    M A C R O   D E F I N I T I O N           */
7
8 #ifndef _ASSERT_H
9 #define _ASSERT_H
10
11 #ifndef NDEBUG
12 /*      Note: this macro uses parameter substitution inside strings */
13 #define assert(exp)     (exp || (fprintf(stderr,"Assertion \"%s\" failed: file %s, line %d\n", "exp", __FILE__, __LINE__), exit(1)))
14 #define _assert(exp)    (exp || (fprintf(stderr,"Assertion \"%s\" failed: file %s, line %d\n", "exp", __FILE__, __LINE__), exit(1)))
15 #else
16 #define assert(exp)     (1)
17 #define _assert(exp)    (1)
18 #endif  /* NDEBUG */
19 #endif /* _ASSERT_H */