diff options
| author | 2020-08-27 11:09:02 -0400 | |
|---|---|---|
| committer | 2020-08-27 11:09:02 -0400 | |
| commit | 3f7b0e07721bf383325d874367efd7302e617fad (patch) | |
| tree | fd374ae8e00159c6fabde1d21aeca9b3c0159a15 /src | |
| parent | Merge pull request #4524 from lioncash/memory-log (diff) | |
| parent | common/assert: Make use of C++ attribute syntax (diff) | |
| download | yuzu-3f7b0e07721bf383325d874367efd7302e617fad.tar.gz yuzu-3f7b0e07721bf383325d874367efd7302e617fad.tar.xz yuzu-3f7b0e07721bf383325d874367efd7302e617fad.zip | |
Merge pull request #4577 from lioncash/asserts
common/assert: Make use of C++ attribute syntax
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/assert.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/assert.h b/src/common/assert.h index 5b67c5c52..06d7b5612 100644 --- a/src/common/assert.h +++ b/src/common/assert.h | |||
| @@ -17,11 +17,12 @@ | |||
| 17 | // enough for our purposes. | 17 | // enough for our purposes. |
| 18 | template <typename Fn> | 18 | template <typename Fn> |
| 19 | #if defined(_MSC_VER) | 19 | #if defined(_MSC_VER) |
| 20 | __declspec(noinline, noreturn) | 20 | [[msvc::noinline, noreturn]] |
| 21 | #elif defined(__GNUC__) | 21 | #elif defined(__GNUC__) |
| 22 | __attribute__((noinline, noreturn, cold)) | 22 | [[gnu::cold, gnu::noinline, noreturn]] |
| 23 | #endif | 23 | #endif |
| 24 | static void assert_noinline_call(const Fn& fn) { | 24 | static void |
| 25 | assert_noinline_call(const Fn& fn) { | ||
| 25 | fn(); | 26 | fn(); |
| 26 | Crash(); | 27 | Crash(); |
| 27 | exit(1); // Keeps GCC's mouth shut about this actually returning | 28 | exit(1); // Keeps GCC's mouth shut about this actually returning |