summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-10-27 09:48:22 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-10-27 09:48:22 +0300
commit44f9736e0b5608920199e3f51cfa72b597a88e4f (patch)
tree2b622a29f6ba3916d6ef7534b28ac2be1d1f80d4 /include
parent49098bfd4908ff3a33ae6c6a30c2a9b7dd90e4df (diff)
parent05a0eae335ebdd1f9ac7540c263b870a17d69b9f (diff)
downloadmariadb-git-st-10.5-merge.tar.gz
Merge 10.4 into 10.5st-10.5-merge
Diffstat (limited to 'include')
-rw-r--r--include/scope.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/scope.h b/include/scope.h
index b9e2e96ae5c..e0e9fc62969 100644
--- a/include/scope.h
+++ b/include/scope.h
@@ -64,3 +64,11 @@ make_scope_exit(Callable &&f)
return detail::scope_exit<typename std::decay<Callable>::type>(
std::forward<Callable>(f));
}
+
+#define CONCAT_IMPL(x, y) x##y
+
+#define CONCAT(x, y) CONCAT_IMPL(x, y)
+
+#define ANONYMOUS_VARIABLE CONCAT(_anonymous_variable, __LINE__)
+
+#define SCOPE_EXIT auto ANONYMOUS_VARIABLE= make_scope_exit