1 /* $XConsortium: macros.h /main/1 1996/07/29 17:08:55 cde-hp $ */
2 // Copyright (c) 1994 James Clark
3 // See the file COPYING for copying permission.
5 #ifndef macros_INCLUDED
6 #define macros_INCLUDED 1
9 #define __attribute__(args) /* as nothing */
15 #define ASSERT(expr) ((void)0)
16 #define CANNOT_HAPPEN() ((void)abort())
18 #else /* not NDEBUG */
21 namespace SP_NAMESPACE {
23 extern SP_API void assertionFailed(const char *, const char *, int)
24 __attribute__((noreturn));
29 #define ASSERT(expr) \
31 (::SP_NAMESPACE_SCOPE assertionFailed(# expr, __FILE__, __LINE__), 0)))
32 #define CANNOT_HAPPEN() ASSERT(0)
34 #endif /* not NDEBUG */
36 #define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
38 #endif /* not macros_INCLUDED */