+#define wxON_BLOCK_EXIT2_IMPL(n, f, p1, p2) \
+ wxScopeGuard n = wxMakeGuard(f, p1, p2); \
+ wxPrivateUse(n)
+#define wxON_BLOCK_EXIT2(f, p1, p2) \
+ wxON_BLOCK_EXIT2_IMPL(wxGuardName, f, p1, p2)
+
+#define wxON_BLOCK_EXIT_OBJ2_IMPL(n, o, m, p1, p2) \
+ wxScopeGuard n = wxMakeObjGuard(o, m, p1, p2); \
+ wxPrivateUse(n)
+#define wxON_BLOCK_EXIT_OBJ2(o, m, p1, p2) \
+ wxON_BLOCK_EXIT_OBJ2_IMPL(wxGuardName, o, &m, p1, p2)
+
+#define wxON_BLOCK_EXIT_THIS2(m, p1, p2) \
+ wxON_BLOCK_EXIT_OBJ2(*this, m, p1, p2)
+
+
+#define wxSetterName wxMAKE_UNIQUE_NAME(wxVarSetter)
+
+#define wxON_BLOCK_EXIT_SET_IMPL(n, var, value) \
+ wxPrivate::VariableSetter n = wxMakeVarSetter(var, value); \
+ wxPrivateUse(n)
+
+#define wxON_BLOCK_EXIT_SET(var, value) \
+ wxON_BLOCK_EXIT_SET_IMPL(wxSetterName, var, value)
+
+#define wxON_BLOCK_EXIT_NULL_IMPL(n, var) \
+ wxPrivate::VariableSetter n = wxMakeVarNuller(var); \
+ wxPrivateUse(n)
+
+#define wxON_BLOCK_EXIT_NULL(ptr) \
+ wxON_BLOCK_EXIT_NULL_IMPL(wxSetterName, ptr)
+
+#endif // _WX_SCOPEGUARD_H_