summaryrefslogtreecommitdiffstats
path: root/src/common/scope_exit.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-02-06 08:00:43 +0100
committerGitHub <noreply@github.com>2021-02-06 08:00:43 +0100
commit1498a7c9a84037d7c78ff21b3bc996622269db43 (patch)
tree0fb418f721db6e307fb7105cc57fe3a2eec7d0bf /src/common/scope_exit.h
parentMerge pull request #5875 from lioncash/identifier (diff)
parenthle: kernel: Drop R_UNLESS_NOLOG in favor of expanded if-statement. (diff)
downloadyuzu-1498a7c9a84037d7c78ff21b3bc996622269db43.tar
yuzu-1498a7c9a84037d7c78ff21b3bc996622269db43.tar.gz
yuzu-1498a7c9a84037d7c78ff21b3bc996622269db43.tar.bz2
yuzu-1498a7c9a84037d7c78ff21b3bc996622269db43.tar.lz
yuzu-1498a7c9a84037d7c78ff21b3bc996622269db43.tar.xz
yuzu-1498a7c9a84037d7c78ff21b3bc996622269db43.tar.zst
yuzu-1498a7c9a84037d7c78ff21b3bc996622269db43.zip
Diffstat (limited to 'src/common/scope_exit.h')
-rw-r--r--src/common/scope_exit.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h
index fa46cb394..35dac3a8f 100644
--- a/src/common/scope_exit.h
+++ b/src/common/scope_exit.h
@@ -49,3 +49,9 @@ ScopeExitHelper<Func> ScopeExit(Func&& func) {
* \endcode
*/
#define SCOPE_EXIT(body) auto CONCAT2(scope_exit_helper_, __LINE__) = detail::ScopeExit([&]() body)
+
+/**
+ * This macro is similar to SCOPE_EXIT, except the object is caller managed. This is intended to be
+ * used when the caller might want to cancel the ScopeExit.
+ */
+#define SCOPE_GUARD(body) detail::ScopeExit([&]() body)