brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 904597f Raw
41 lines · c
1#pragma clang system_header2 3int abort();4 5#ifdef NDEBUG6#define assert(x) 17#else8#define assert(x)                                                              \9  if (!(x))                                                                    \10  (void)abort()11#endif12 13void print(...);14#define assert2(e) (__builtin_expect(!(e), 0) ?                                \15                       print (#e, __FILE__, __LINE__) : (void)0)16 17#ifdef NDEBUG18#define my_assert(x) 119#else20#define my_assert(x)                                                           \21  ((void)((x) ? 1 : abort()))22#endif23 24#ifdef NDEBUG25#define not_my_assert(x) 126#else27#define not_my_assert(x)                                                       \28  if (!(x))                                                                    \29  (void)abort()30#endif31 32#define real_assert(x) ((void)((x) ? 1 : abort()))33#define wrap1(x) real_assert(x)34#define wrap2(x) wrap1(x)35#define convoluted_assert(x) wrap2(x)36 37#define msvc_assert(expression) (void)(                                        \38            (!!(expression)) ||                                                \39            (abort(), 0)                                                       \40        )41