summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-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);
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) {