From fbeea2691997d1769603438f4dc1781dfa6365ca Mon Sep 17 00:00:00 2001 From: Alula Date: Wed, 24 Jun 2026 20:51:39 +0200 Subject: [PATCH] ams: add R_UNLESS_LOG() --- .../libvapours/include/vapours/results/results_common.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/libvapours/include/vapours/results/results_common.hpp b/libraries/libvapours/include/vapours/results/results_common.hpp index a9a72505b..a013d7c9d 100644 --- a/libraries/libvapours/include/vapours/results/results_common.hpp +++ b/libraries/libvapours/include/vapours/results/results_common.hpp @@ -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. #define R_SUCCEED_IF(expr) R_UNLESS(!(expr), ResultSuccess())