assert: Use false in asserts rather than 0
Quiets extended warnings.
This commit is contained in:
parent
8c7a81a308
commit
67706c208b
1 changed files with 2 additions and 2 deletions
|
@ -29,13 +29,13 @@ static void assert_noinline_call(const Fn& fn) {
|
||||||
do if (!(_a_)) { assert_noinline_call([] { \
|
do if (!(_a_)) { assert_noinline_call([] { \
|
||||||
fprintf(stderr, "Assertion Failed!\n" #_a_); \
|
fprintf(stderr, "Assertion Failed!\n" #_a_); \
|
||||||
throw ""; \
|
throw ""; \
|
||||||
}); } while (0)
|
}); } while (false)
|
||||||
|
|
||||||
#define ASSERT_MSG(_a_, ...) \
|
#define ASSERT_MSG(_a_, ...) \
|
||||||
do if (!(_a_)) { assert_noinline_call([&] { \
|
do if (!(_a_)) { assert_noinline_call([&] { \
|
||||||
fprintf(stderr, "Assertion Failed!\n" #_a_ "\n" __VA_ARGS__); \
|
fprintf(stderr, "Assertion Failed!\n" #_a_ "\n" __VA_ARGS__); \
|
||||||
throw ""; \
|
throw ""; \
|
||||||
}); } while (0)
|
}); } while (false)
|
||||||
|
|
||||||
#define UNREACHABLE() ASSERT_MSG(false, "Unreachable code!")
|
#define UNREACHABLE() ASSERT_MSG(false, "Unreachable code!")
|
||||||
#define UNREACHABLE_MSG(...) ASSERT_MSG(false, __VA_ARGS__)
|
#define UNREACHABLE_MSG(...) ASSERT_MSG(false, __VA_ARGS__)
|
||||||
|
|
Loading…
Reference in a new issue