summaryrefslogtreecommitdiffstats
path: root/src/common/assert.h
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
commitdc8479928c5aee4c6ad6fe4f59006fb604cee701 (patch)
tree569a7f13128450bbab973236615587ff00bced5f /src/common/assert.h
parentTravis: Import Dolphin’s clang-format hook. (diff)
downloadyuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.gz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.bz2
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.lz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.xz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.zst
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.zip
Diffstat (limited to '')
-rw-r--r--src/common/assert.h26
1 files changed, 15 insertions, 11 deletions
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 <typename Fn>
#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__)