mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-26 05:16:24 -05:00
core: hle: result: Fix code for compilers.
This commit is contained in:
parent
3794851f7f
commit
46322be735
1 changed files with 7 additions and 6 deletions
|
@ -423,16 +423,17 @@ constexpr void UpdateCurrentResultReference<const Result>(Result result_referenc
|
||||||
} // namespace ResultImpl
|
} // namespace ResultImpl
|
||||||
|
|
||||||
#define DECLARE_CURRENT_RESULT_REFERENCE_AND_STORAGE(COUNTER_VALUE) \
|
#define DECLARE_CURRENT_RESULT_REFERENCE_AND_STORAGE(COUNTER_VALUE) \
|
||||||
[[maybe_unused]] constexpr bool HasPrevRef_##COUNTER_VALUE = \
|
[[maybe_unused]] constexpr bool CONCAT2(HasPrevRef_, COUNTER_VALUE) = \
|
||||||
std::same_as<decltype(__TmpCurrentResultReference), Result&>; \
|
std::same_as<decltype(__TmpCurrentResultReference), Result&>; \
|
||||||
[[maybe_unused]] auto& PrevRef_##COUNTER_VALUE = __TmpCurrentResultReference; \
|
[[maybe_unused]] Result CONCAT2(PrevRef_, COUNTER_VALUE) = __TmpCurrentResultReference; \
|
||||||
[[maybe_unused]] Result __tmp_result_##COUNTER_VALUE = ResultSuccess; \
|
[[maybe_unused]] Result CONCAT2(__tmp_result_, COUNTER_VALUE) = ResultSuccess; \
|
||||||
Result& __TmpCurrentResultReference = \
|
Result& __TmpCurrentResultReference = CONCAT2(HasPrevRef_, COUNTER_VALUE) \
|
||||||
HasPrevRef_##COUNTER_VALUE ? PrevRef_##COUNTER_VALUE : __tmp_result_##COUNTER_VALUE
|
? CONCAT2(PrevRef_, COUNTER_VALUE) \
|
||||||
|
: CONCAT2(__tmp_result_, COUNTER_VALUE)
|
||||||
|
|
||||||
#define ON_RESULT_RETURN_IMPL(...) \
|
#define ON_RESULT_RETURN_IMPL(...) \
|
||||||
static_assert(std::same_as<decltype(__TmpCurrentResultReference), Result&>); \
|
static_assert(std::same_as<decltype(__TmpCurrentResultReference), Result&>); \
|
||||||
auto RESULT_GUARD_STATE_##__COUNTER__ = \
|
auto CONCAT2(RESULT_GUARD_STATE_, __COUNTER__) = \
|
||||||
ResultImpl::ResultReferenceForScopedResultGuard<__VA_ARGS__>( \
|
ResultImpl::ResultReferenceForScopedResultGuard<__VA_ARGS__>( \
|
||||||
__TmpCurrentResultReference) + \
|
__TmpCurrentResultReference) + \
|
||||||
[&]()
|
[&]()
|
||||||
|
|
Loading…
Reference in a new issue