Răsfoiți Sursa

common: common_funcs: Add useful kernel macro R_SUCCEED_IF.

bunnei 5 ani în urmă
părinte
comite
bb966d3e33
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 3 0
      src/common/common_funcs.h

+ 3 - 0
src/common/common_funcs.h

@@ -112,6 +112,9 @@ __declspec(dllimport) void __stdcall DebugBreak(void);
         }                                                                                          \
     }
 
+/// Evaluates a boolean expression, and succeeds if that expression is true.
+#define R_SUCCEED_IF(expr) R_UNLESS(!(expr), RESULT_SUCCESS)
+
 namespace Common {
 
 [[nodiscard]] constexpr u32 MakeMagic(char a, char b, char c, char d) {