mirror of
https://gitlab.com/suyu-emu/suyu.git
synced 2024-03-15 23:15:44 +00:00
common: common_funcs: Add R_UNLESS macro.
This commit is contained in:
parent
f12701b303
commit
92d5c63f01
|
@ -93,6 +93,14 @@ __declspec(dllimport) void __stdcall DebugBreak(void);
|
||||||
return static_cast<T>(key) == 0; \
|
return static_cast<T>(key) == 0; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Evaluates a boolean expression, and returns a result unless that expression is true.
|
||||||
|
#define R_UNLESS(expr, res) \
|
||||||
|
{ \
|
||||||
|
if (!(expr)) { \
|
||||||
|
return res; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
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