1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2025-02-24 15:55:41 -05:00

Turn assertion into expression instead of statement

This commit is contained in:
Alex Kotov 2021-12-15 01:48:35 +05:00
parent fc4fbd64b4
commit c397165dd4
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -6,7 +6,7 @@ extern "C" {
#endif
#define kernaux_assert(cond) \
{ if (!(cond)) kernaux_assert_do(__FILE__, __LINE__, #cond); }
((cond) ? (void)0 : kernaux_assert_do(__FILE__, __LINE__, #cond))
void kernaux_assert_do(const char *file, int line, const char *str);