diff options
author | Lioncash <mathew1800@gmail.com> | 2020-08-14 15:04:44 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2020-08-14 15:09:20 +0200 |
commit | 2296e921d261857f4cb54efdad779f1f4626270d (patch) | |
tree | b4799cd5513bc20c18a1bc3b168b61a9f728e602 /src/core/hle/result.h | |
parent | Merge pull request #4495 from lioncash/conv (diff) | |
download | yuzu-2296e921d261857f4cb54efdad779f1f4626270d.tar yuzu-2296e921d261857f4cb54efdad779f1f4626270d.tar.gz yuzu-2296e921d261857f4cb54efdad779f1f4626270d.tar.bz2 yuzu-2296e921d261857f4cb54efdad779f1f4626270d.tar.lz yuzu-2296e921d261857f4cb54efdad779f1f4626270d.tar.xz yuzu-2296e921d261857f4cb54efdad779f1f4626270d.tar.zst yuzu-2296e921d261857f4cb54efdad779f1f4626270d.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/result.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/hle/result.h b/src/core/hle/result.h index 450f61fea..b6bdbd988 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h @@ -342,8 +342,9 @@ ResultVal<std::remove_reference_t<Arg>> MakeResult(Arg&& arg) { */ #define CASCADE_RESULT(target, source) \ auto CONCAT2(check_result_L, __LINE__) = source; \ - if (CONCAT2(check_result_L, __LINE__).Failed()) \ + if (CONCAT2(check_result_L, __LINE__).Failed()) { \ return CONCAT2(check_result_L, __LINE__).Code(); \ + } \ target = std::move(*CONCAT2(check_result_L, __LINE__)) /** @@ -351,6 +352,9 @@ ResultVal<std::remove_reference_t<Arg>> MakeResult(Arg&& arg) { * non-success, or discarded otherwise. */ #define CASCADE_CODE(source) \ - auto CONCAT2(check_result_L, __LINE__) = source; \ - if (CONCAT2(check_result_L, __LINE__).IsError()) \ - return CONCAT2(check_result_L, __LINE__); + do { \ + auto CONCAT2(check_result_L, __LINE__) = source; \ + if (CONCAT2(check_result_L, __LINE__).IsError()) { \ + return CONCAT2(check_result_L, __LINE__); \ + } \ + } while (false) |