assert: Use false in asserts rather than 0

Quiets extended warnings.
This commit is contained in:
Lioncash 2016-08-23 09:03:22 -04:00 committed by MerryMage
parent 8c7a81a308
commit 67706c208b

View file

@ -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__)