BAN: Add parenthesis in ASSERT macros

This commit is contained in:
Bananymous 2024-02-25 21:22:47 +02:00
parent 59abb5d344
commit 6ebfe05fce
1 changed files with 2 additions and 2 deletions
BAN/include/BAN

View File

@ -13,8 +13,8 @@
#define __ASSERT_BIN_OP(lhs, rhs, name, op) \ #define __ASSERT_BIN_OP(lhs, rhs, name, op) \
do { \ do { \
auto&& _lhs = lhs; \ auto&& _lhs = (lhs); \
auto&& _rhs = rhs; \ auto&& _rhs = (rhs); \
if (!(_lhs op _rhs)) \ if (!(_lhs op _rhs)) \
Kernel::panic(name "(" #lhs ", " #rhs ") ({} " #op " {}) failed", _lhs, _rhs); \ Kernel::panic(name "(" #lhs ", " #rhs ") ({} " #op " {}) failed", _lhs, _rhs); \
} while (false) } while (false)