ams: add R_UNLESS_LOG()

This commit is contained in:
Alula 2026-06-24 20:51:39 +02:00
parent 38251801df
commit fbeea26919
No known key found for this signature in database
GPG Key ID: 3E00485503A1D8BA

View File

@ -494,6 +494,14 @@ namespace ams::result::impl {
} \ } \
} }
#define R_UNLESS_LOG(expr, res, ...) \
{ \
if (!(expr)) { \
AMS_LOG(__VA_ARGS__); \
R_THROW(res); \
} \
}
/// Evaluates a boolean expression, and succeeds if that expression is true. /// Evaluates a boolean expression, and succeeds if that expression is true.
#define R_SUCCEED_IF(expr) R_UNLESS(!(expr), ResultSuccess()) #define R_SUCCEED_IF(expr) R_UNLESS(!(expr), ResultSuccess())