diff options
| author | 2015-01-30 15:00:17 +0100 | |
|---|---|---|
| committer | 2015-01-30 15:00:17 +0100 | |
| commit | 28702cbfeb1fe21109f8b1efa189785594319b78 (patch) | |
| tree | 64e4b1ec43b7699fe1a6ab1be1c688b6d63c0d75 /src/common | |
| parent | Merge pull request #412 from purpasmart96/svc_table_cleanup (diff) | |
| parent | Kernel: Mark all appropriate kernel objects as "final" (diff) | |
| download | yuzu-28702cbfeb1fe21109f8b1efa189785594319b78.tar.gz yuzu-28702cbfeb1fe21109f8b1efa189785594319b78.tar.xz yuzu-28702cbfeb1fe21109f8b1efa189785594319b78.zip | |
Merge pull request #503 from yuriks/kernel-lifetime4
Kernel Lifetime Reform Pt. 4
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/common_funcs.h | 4 | ||||
| -rw-r--r-- | src/common/scope_exit.h | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index c2750a63c..229eb74c9 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h | |||
| @@ -31,6 +31,10 @@ template<> struct CompileTimeAssert<true> {}; | |||
| 31 | 31 | ||
| 32 | #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) | 32 | #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) |
| 33 | 33 | ||
| 34 | /// Textually concatenates two tokens. The double-expansion is required by the C preprocessor. | ||
| 35 | #define CONCAT2(x, y) DO_CONCAT2(x, y) | ||
| 36 | #define DO_CONCAT2(x, y) x ## y | ||
| 37 | |||
| 34 | #ifndef _MSC_VER | 38 | #ifndef _MSC_VER |
| 35 | 39 | ||
| 36 | #include <errno.h> | 40 | #include <errno.h> |
diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h index 263beaf0e..77dcbaa22 100644 --- a/src/common/scope_exit.h +++ b/src/common/scope_exit.h | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "common/common_funcs.h" | ||
| 8 | |||
| 7 | namespace detail { | 9 | namespace detail { |
| 8 | template <typename Func> | 10 | template <typename Func> |
| 9 | struct ScopeExitHelper { | 11 | struct ScopeExitHelper { |
| @@ -34,4 +36,4 @@ namespace detail { | |||
| 34 | * } | 36 | * } |
| 35 | * \endcode | 37 | * \endcode |
| 36 | */ | 38 | */ |
| 37 | #define SCOPE_EXIT(body) auto scope_exit_helper_##__LINE__ = detail::ScopeExit([&]() body) | 39 | #define SCOPE_EXIT(body) auto CONCAT2(scope_exit_helper_, __LINE__) = detail::ScopeExit([&]() body) |