ladybird
ladybird copied to clipboard
AK: Add optional `message` argument to VERIFY and friends
This PR effectively reverts 079edff.
This works only in clang-cl, doesn't work in clang/gcc by default:
#define VERIFY(expr, msg...) func(#expr, msg)
This works in 2 CIs, fails in other two with expected primary-expression before ‘)’ token:
#define VERIFY(expr, msg...) func(#expr ,##msg)
This produces warning: __VA_OPT__ can only appear in the expansion of a C++2a variadic macro
:
#define VERIFY(expr, msg...) func(#expr __VA_OPT__(,) msg)
That's how I arrived at this abomination:
#define VERIFY(expr, ...) func(#expr __VA_OPT__(,) __VA_ARGS__)