1987-03-09 21:20:21 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
1994-06-24 11:31:16 +00:00
|
|
|
/* $Id$ */
|
1987-02-09 15:26:16 +00:00
|
|
|
/* A S S E R T I O N M A C R O D E F I N I T I O N */
|
|
|
|
|
1991-10-25 14:44:21 +00:00
|
|
|
#ifndef _ASSERT_H
|
|
|
|
#define _ASSERT_H
|
|
|
|
|
1987-02-09 15:26:16 +00:00
|
|
|
#ifndef NDEBUG
|
|
|
|
/* Note: this macro uses parameter substitution inside strings */
|
|
|
|
#define assert(exp) (exp || (fprintf(stderr,"Assertion \"%s\" failed: file %s, line %d\n", "exp", __FILE__, __LINE__), exit(1)))
|
|
|
|
#define _assert(exp) (exp || (fprintf(stderr,"Assertion \"%s\" failed: file %s, line %d\n", "exp", __FILE__, __LINE__), exit(1)))
|
|
|
|
#else
|
|
|
|
#define assert(exp) (1)
|
|
|
|
#define _assert(exp) (1)
|
1991-12-17 11:41:12 +00:00
|
|
|
#endif /* NDEBUG */
|
1991-10-25 14:44:21 +00:00
|
|
|
#endif /* _ASSERT_H */
|