assert: Use attribute specifier syntax with non MSVC compilers (#12)
This commit is contained in:
parent
cc3e7e71aa
commit
3e03524658
@ -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_) \
|
||||
|
Loading…
x
Reference in New Issue
Block a user