diff options
| author | 2023-10-22 21:16:38 -0400 | |
|---|---|---|
| committer | 2023-11-10 12:01:35 -0500 | |
| commit | 2a255b2d61a445fb2b83cc8af7632e3d720e1292 (patch) | |
| tree | 37f5c16ba52339d91e57c5b975639dc1eb60b9f7 /src/core/hle/result.h | |
| parent | Merge pull request #11981 from lucasreis1/patch (diff) | |
| download | yuzu-2a255b2d61a445fb2b83cc8af7632e3d720e1292.tar.gz yuzu-2a255b2d61a445fb2b83cc8af7632e3d720e1292.tar.xz yuzu-2a255b2d61a445fb2b83cc8af7632e3d720e1292.zip | |
kernel: add KPageTableBase
Co-authored-by: Kelebek1 <eeeedddccc@hotmail.co.uk>
Diffstat (limited to 'src/core/hle/result.h')
| -rw-r--r-- | src/core/hle/result.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/core/hle/result.h b/src/core/hle/result.h index dd0b27f47..749f51f69 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h | |||
| @@ -407,3 +407,34 @@ constexpr inline Result __TmpCurrentResultReference = ResultSuccess; | |||
| 407 | 407 | ||
| 408 | /// Evaluates a boolean expression, and succeeds if that expression is true. | 408 | /// Evaluates a boolean expression, and succeeds if that expression is true. |
| 409 | #define R_SUCCEED_IF(expr) R_UNLESS(!(expr), ResultSuccess) | 409 | #define R_SUCCEED_IF(expr) R_UNLESS(!(expr), ResultSuccess) |
| 410 | |||
| 411 | #define R_TRY_CATCH(res_expr) \ | ||
| 412 | { \ | ||
| 413 | const auto R_CURRENT_RESULT = (res_expr); \ | ||
| 414 | if (R_FAILED(R_CURRENT_RESULT)) { \ | ||
| 415 | if (false) | ||
| 416 | |||
| 417 | #define R_END_TRY_CATCH \ | ||
| 418 | else if (R_FAILED(R_CURRENT_RESULT)) { \ | ||
| 419 | R_THROW(R_CURRENT_RESULT); \ | ||
| 420 | } \ | ||
| 421 | } \ | ||
| 422 | } | ||
| 423 | |||
| 424 | #define R_CATCH_ALL() \ | ||
| 425 | } \ | ||
| 426 | else if (R_FAILED(R_CURRENT_RESULT)) { \ | ||
| 427 | if (true) | ||
| 428 | |||
| 429 | #define R_CATCH(res_expr) \ | ||
| 430 | } \ | ||
| 431 | else if ((res_expr) == (R_CURRENT_RESULT)) { \ | ||
| 432 | if (true) | ||
| 433 | |||
| 434 | #define R_CONVERT(catch_type, convert_type) \ | ||
| 435 | R_CATCH(catch_type) { R_THROW(static_cast<Result>(convert_type)); } | ||
| 436 | |||
| 437 | #define R_CONVERT_ALL(convert_type) \ | ||
| 438 | R_CATCH_ALL() { R_THROW(static_cast<Result>(convert_type)); } | ||
| 439 | |||
| 440 | #define R_ASSERT(res_expr) ASSERT(R_SUCCEEDED(res_expr)) | ||