mirror of
https://gitlab.com/suyu-emu/suyu.git
synced 2024-03-15 23:15:44 +00:00
common: common_funcs: Add a few more useful macros for kernel code.
This commit is contained in:
parent
4dbf3f4880
commit
2fb77adb9f
|
@ -101,6 +101,17 @@ __declspec(dllimport) void __stdcall DebugBreak(void);
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define R_SUCCEEDED(res) (res.IsSuccess())
|
||||||
|
|
||||||
|
/// Evaluates an expression that returns a result, and returns the result if it would fail.
|
||||||
|
#define R_TRY(res_expr) \
|
||||||
|
{ \
|
||||||
|
const auto _tmp_r_try_rc = (res_expr); \
|
||||||
|
if (_tmp_r_try_rc.IsError()) { \
|
||||||
|
return _tmp_r_try_rc; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
|
||||||
[[nodiscard]] constexpr u32 MakeMagic(char a, char b, char c, char d) {
|
[[nodiscard]] constexpr u32 MakeMagic(char a, char b, char c, char d) {
|
||||||
|
|
Loading…
Reference in a new issue