1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-12 16:50:22 +02:00
guile/assert.h
Andy Wingo d2828975a5 Switch mark-sweep collector to mark stack
Slows down performance though!  Have to think here.
2022-03-11 11:23:58 +01:00

15 lines
342 B
C

#ifndef ASSERT_H
#define ASSERT_H
#define STATIC_ASSERT_EQ(a, b) _Static_assert((a) == (b), "eq")
#define UNLIKELY(e) __builtin_expect(e, 0)
#ifndef NDEBUG
#define ASSERT(x) do { if (UNLIKELY(!(x))) __builtin_trap(); } while (0)
#else
#define ASSERT(x) do { } while (0)
#endif
#define ASSERT_EQ(a,b) ASSERT((a) == (b))
#endif // ASSERT_H