Significant progress to getting pl1$pl1 to compile something, implemented many necess...
[multics_sim.git] / rassert.h
1 #ifndef _RASSERT_H
2 #define _RASSERT_H 1
3
4 // tries to be the same as assert(), but always present even with NDEBUG
5
6 #ifdef __GLIBC__
7 extern void __assert_fail (const char *__assertion, const char *__file,
8                            unsigned int __line, const char *__function)
9      __THROW __attribute__ ((__noreturn__));
10
11 # define rassert(expr)                                                  \
12   ((expr)                                                               \
13    ? (void) (0)                                         \
14    : __assert_fail (#expr, __FILE__, __LINE__, __extension__ __PRETTY_FUNCTION__))
15 #else
16 // for unsupported platforms, it won't work with NDEBUG
17 #include <assert.h>
18
19 #define rassert(expr) assert(expr)
20 #endif
21
22 #endif