0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd: Complete the assert workaround for clang.

This commit is contained in:
Jason Volk 2020-02-12 14:32:18 -08:00
parent c3f0803e49
commit c63141c4dc

View file

@ -109,9 +109,15 @@ extern "C"
#undef major
#undef minor
// Trouble. clang++-8
#ifndef assert
#define assert(expr) (static_cast<void>(0))
// Trouble; clang.
#if defined(__clang__) && !defined(assert)
#ifdef NDEBUG
#define assert(expr) \
(static_cast<void>(0))
#else
#define assert(expr) \
(static_cast<bool>(expr)? void(0): __assert_fail(#expr, __FILE__, __LINE__, __FUNCTION__))
#endif
#endif
//////////////////////////////////////////////////////////////////////////////>