diff options
author | bunnei <bunneidev@gmail.com> | 2021-01-11 14:36:26 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-11 14:36:26 -0800 |
commit | eb3cb54aa53e23af61afb9b7e35af28c9d37ae2a (patch) | |
tree | 56a80760bd0ba8ecd85dc8d9f09fb9e2068c91d4 /src/common/common_funcs.h | |
parent | 46cd71d1c773c29cce8b48e7e2b478bdf6d77085 (diff) | |
parent | 03dfc8d8e74910d447b755e00848a623ec65cd93 (diff) |
Merge pull request #5266 from bunnei/kernel-synch
Rewrite KSynchronizationObject, KConditonVariable, and KAddressArbiter
Diffstat (limited to 'src/common/common_funcs.h')
-rw-r--r-- | src/common/common_funcs.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index 367b6bf6e..c90978f9c 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h @@ -93,6 +93,14 @@ __declspec(dllimport) void __stdcall DebugBreak(void); 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 { [[nodiscard]] constexpr u32 MakeMagic(char a, char b, char c, char d) { |