assert: Use attribute specifier syntax with non MSVC compilers (#12)

This commit is contained in:
Mat M 2016-09-03 07:48:07 -04:00 committed by Merry
parent cc3e7e71aa
commit 3e03524658

View file

@ -18,11 +18,11 @@ template <typename Fn>
#if defined(_MSC_VER)
__declspec(noinline, noreturn)
#elif defined(__GNUC__)
__attribute__((noinline, noreturn, cold))
[[noreturn, gnu::noinline, gnu::cold]]
#endif
static void assert_noinline_call(const Fn& fn) {
fn();
exit(1); // Keeps GCC's mouth shut about this actually returning
exit(EXIT_FAILURE); // Keeps GCC's mouth shut about this actually returning
}
#define ASSERT(_a_) \