034d0b08e9
in a statement such as: if(expr) assert(a); else assert(b); the previous definition of assert would fail to compile, as the else would be dangling. with a ternary expression, this construct works fine.
18 lines
294 B
C
18 lines
294 B
C
#pragma lib "/$M/lib/ape/libap.a"
|
|
|
|
#undef assert
|
|
#ifdef NDEBUG
|
|
#define assert(ignore) ((void)0)
|
|
#else
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
extern void _assert(char *, unsigned);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#define assert(e) ((e) ? (void)0 : _assert(__FILE__, __LINE__))
|
|
#endif /* NDEBUG */
|