summaryrefslogtreecommitdiff
path: root/zen/scope_guard.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <shieldwed@outlook.com>2018-05-09 00:11:35 +0200
committerDaniel Wilhelm <shieldwed@outlook.com>2018-05-09 00:11:35 +0200
commit015bb675d6eb177900c8ac94a6d35edc5ad90576 (patch)
treeedde4153ce9b2ba6bdaf9d3c0af0966ed6dfd717 /zen/scope_guard.h
parent9.8 (diff)
downloadFreeFileSync-015bb675d6eb177900c8ac94a6d35edc5ad90576.tar.gz
FreeFileSync-015bb675d6eb177900c8ac94a6d35edc5ad90576.tar.bz2
FreeFileSync-015bb675d6eb177900c8ac94a6d35edc5ad90576.zip
9.9
Diffstat (limited to 'zen/scope_guard.h')
-rwxr-xr-xzen/scope_guard.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/zen/scope_guard.h b/zen/scope_guard.h
index 6945b011..328e2caa 100755
--- a/zen/scope_guard.h
+++ b/zen/scope_guard.h
@@ -115,6 +115,10 @@ auto makeGuard(F&& fun) { return ScopeGuard<runMode, std::decay_t<F>>(std::forwa
#define ZEN_CONCAT_SUB(X, Y) X ## Y
#define ZEN_CONCAT(X, Y) ZEN_CONCAT_SUB(X, Y)
+#define ZEN_CHECK_CASE_FOR_CONSTANT(X) case X: return ZEN_CHECK_CASE_FOR_CONSTANT_IMPL(#X)
+#define ZEN_CHECK_CASE_FOR_CONSTANT_IMPL(X) L ## X
+
+
#define ZEN_ON_SCOPE_EXIT(X) auto ZEN_CONCAT(dummy, __LINE__) = zen::makeGuard<zen::ScopeGuardRunMode::ON_EXIT >([&]{ X; }); (void)ZEN_CONCAT(dummy, __LINE__);
#define ZEN_ON_SCOPE_FAIL(X) auto ZEN_CONCAT(dummy, __LINE__) = zen::makeGuard<zen::ScopeGuardRunMode::ON_FAIL >([&]{ X; }); (void)ZEN_CONCAT(dummy, __LINE__);
#define ZEN_ON_SCOPE_SUCCESS(X) auto ZEN_CONCAT(dummy, __LINE__) = zen::makeGuard<zen::ScopeGuardRunMode::ON_SUCCESS>([&]{ X; }); (void)ZEN_CONCAT(dummy, __LINE__);
bgstack15