ack/lang/cem/libcc.ansi/headers/assert.h

24 lines
563 B
C
Raw Normal View History

1989-05-16 13:13:53 +00:00
/*
* assert.h - diagnostics
*
* (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 14:02:31 +00:00
/* $Id$ */
1989-05-16 13:13:53 +00:00
void __bad_assertion(const char *_mess);
1989-05-16 13:13:53 +00:00
#undef assert
#define __str(x) # x
#define __xstr(x) __str(x)
1989-09-29 15:46:33 +00:00
#if defined(NDEBUG)
1989-05-16 13:13:53 +00:00
#define assert(ignore) ((void)0)
#else
#define assert(expr) ((expr)? (void)0 : \
__bad_assertion("Assertion \"" #expr \
"\" failed, file " __xstr(__FILE__) \
", line " __xstr(__LINE__) "\n"))
1989-05-16 13:13:53 +00:00
#endif /* NDEBUG */