Simplify M_ON_EXCEPTION / M_IF_EXCEPTION

This commit is contained in:
Patrick Pelissier committed 2024-04-06 19:13:08 +02:00
1 parent 6cba7ad8ba
commit 12ee3213b0
2 files changed
+16 -8

No files matched your search

+11
View File
@@ -156,6 +156,17 @@ struct m_exception_s {
/********************************** INTERNAL *********************************/
/*****************************************************************************/
#undef M_IF_EXCEPTION
#define M_IF_EXCEPTION(...) __VA_ARGS__
#undef M_ON_EXCEPTION
#define M_ON_EXCEPTION(...) \
for(bool cont = true; cont; cont = false) \
M_DEFER_TRY_INJECT_PRE(cont, __VA_ARGS__) \
for( ; cont ; cont = false) \
M_DEFER_TRY_INJECT_POST(cont, __VA_ARGS__) \
for( ; cont; cont = false)
/*
* Define the C++ back-end.
* It is fully different from C back-end as it reuses the classic try of the C++.