mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-04 22:12:46 +01:00
common/assert: Make use of C++ attribute syntax
Normalizes the syntax used for attributes
This commit is contained in:
parent
b72d2069ba
commit
3bfaabdbdd
1 changed files with 4 additions and 3 deletions
|
@ -17,11 +17,12 @@
|
||||||
// enough for our purposes.
|
// enough for our purposes.
|
||||||
template <typename Fn>
|
template <typename Fn>
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
__declspec(noinline, noreturn)
|
[[msvc::noinline, noreturn]]
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
__attribute__((noinline, noreturn, cold))
|
[[gnu::cold, gnu::noinline, noreturn]]
|
||||||
#endif
|
#endif
|
||||||
static void assert_noinline_call(const Fn& fn) {
|
static void
|
||||||
|
assert_noinline_call(const Fn& fn) {
|
||||||
fn();
|
fn();
|
||||||
Crash();
|
Crash();
|
||||||
exit(1); // Keeps GCC's mouth shut about this actually returning
|
exit(1); // Keeps GCC's mouth shut about this actually returning
|
||||||
|
|
Loading…
Reference in a new issue