From dc8479928c5aee4c6ad6fe4f59006fb604cee701 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 18 Sep 2016 09:38:01 +0900 Subject: Sources: Run clang-format on everything. --- src/common/assert.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/common/assert.h') diff --git a/src/common/assert.h b/src/common/assert.h index cd9b819a9..70214efae 100644 --- a/src/common/assert.h +++ b/src/common/assert.h @@ -18,25 +18,29 @@ // enough for our purposes. template #if defined(_MSC_VER) - __declspec(noinline, noreturn) +__declspec(noinline, noreturn) #elif defined(__GNUC__) __attribute__((noinline, noreturn, cold)) #endif -static void assert_noinline_call(const Fn& fn) { + static void assert_noinline_call(const Fn& fn) { fn(); Crash(); exit(1); // Keeps GCC's mouth shut about this actually returning } -#define ASSERT(_a_) \ - do if (!(_a_)) { assert_noinline_call([] { \ - LOG_CRITICAL(Debug, "Assertion Failed!"); \ - }); } while (0) - -#define ASSERT_MSG(_a_, ...) \ - do if (!(_a_)) { assert_noinline_call([&] { \ - LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); \ - }); } while (0) +#define ASSERT(_a_) \ + do \ + if (!(_a_)) { \ + assert_noinline_call([] { LOG_CRITICAL(Debug, "Assertion Failed!"); }); \ + } \ + while (0) + +#define ASSERT_MSG(_a_, ...) \ + do \ + if (!(_a_)) { \ + assert_noinline_call([&] { LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \ + } \ + while (0) #define UNREACHABLE() ASSERT_MSG(false, "Unreachable code!") #define UNREACHABLE_MSG(...) ASSERT_MSG(false, __VA_ARGS__) -- cgit v1.2.3