From 8923eb681a091980d46a53e76ddfcd18ec897208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?b=CA=B0edoh=E2=82=82=20sw=C3=A9?= Date: Mon, 28 Jul 2025 20:37:20 +0500 Subject: [PATCH] Add VarThrowsExpr --- include/with99.h | 2 +- include/with99/defres.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/with99.h b/include/with99.h index 7f51bdc..97d37bb 100644 --- a/include/with99.h +++ b/include/with99.h @@ -14,7 +14,7 @@ #endif #define WITH99_MAJOR 3 -#define WITH99_MINOR 1 +#define WITH99_MINOR 2 #define WITH99_PATCH 0 #define WITH99_VERSION_COMPATIBLE(x, y, z) (WITH99_MAJOR == (x) && ((WITH99_MINOR == (y) && WITH99_PATCH >= (z)) || (WITH99_MINOR > (y)))) diff --git a/include/with99/defres.h b/include/with99/defres.h index 7cdd9bb..63ba08e 100644 --- a/include/with99/defres.h +++ b/include/with99/defres.h @@ -29,6 +29,13 @@ ML99_just(v((deinit)))\ ) +#define WITH99_resource_VarThrowsExpr_IMPL(type, var, init, deinit, errorexpr) \ + ML99_tuple(\ + ML99_just(v(type var)),\ + ML99_just(v( ((var = init), (errorexpr)) )),\ + ML99_just(v((deinit)))\ + ) + #define WITH99_resource_Call_IMPL(init, deinit) \ ML99_tuple(\ ML99_nothing(),\