summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2020-12-28 22:24:05 -0800
committerGravatar bunnei2021-01-11 14:23:16 -0800
commit92d5c63f0172aa222dca0dbca3aefb4e7b4bec06 (patch)
tree15a25b15493f098c0b96873105ac6a547ca0c8f7 /src
parenthle: kernel: k_scheduler: Cleanup OnThreadPriorityChanged. (diff)
downloadyuzu-92d5c63f0172aa222dca0dbca3aefb4e7b4bec06.tar.gz
yuzu-92d5c63f0172aa222dca0dbca3aefb4e7b4bec06.tar.xz
yuzu-92d5c63f0172aa222dca0dbca3aefb4e7b4bec06.zip
common: common_funcs: Add R_UNLESS macro.
Diffstat (limited to 'src')
-rw-r--r--src/common/common_funcs.h8
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);
93 return static_cast<T>(key) == 0; \ 93 return static_cast<T>(key) == 0; \
94 } 94 }
95 95
96/// Evaluates a boolean expression, and returns a result unless that expression is true.
97#define R_UNLESS(expr, res) \
98 { \
99 if (!(expr)) { \
100 return res; \
101 } \
102 }
103
96namespace Common { 104namespace Common {
97 105
98[[nodiscard]] constexpr u32 MakeMagic(char a, char b, char c, char d) { 106[[nodiscard]] constexpr u32 MakeMagic(char a, char b, char c, char d) {