diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-02-16 14:51:11 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-02-16 14:59:20 +0200 |
commit | 1633f5ec8846408182cceb60dc88f022635f4002 (patch) | |
tree | f2d67f2417517780af0894e6311c5756f4be988d /src/util/epochguard.h | |
parent | 1e8aa02ec5cc2819c67ef40a7573c4b23a4c11cc (diff) |
util, refactor: Add UNIQUE_NAME helper macro
This change replaces repetitive code with a helper macro.
Diffstat (limited to 'src/util/epochguard.h')
-rw-r--r-- | src/util/epochguard.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/epochguard.h b/src/util/epochguard.h index 0fec7d2624..7f6477fb3b 100644 --- a/src/util/epochguard.h +++ b/src/util/epochguard.h @@ -7,6 +7,7 @@ #define BITCOIN_UTIL_EPOCHGUARD_H #include <threadsafety.h> +#include <util/macros.h> #include <cassert> @@ -96,6 +97,6 @@ public: } }; -#define WITH_FRESH_EPOCH(epoch) const Epoch::Guard PASTE2(epoch_guard_, __COUNTER__)(epoch) +#define WITH_FRESH_EPOCH(epoch) const Epoch::Guard UNIQUE_NAME(epoch_guard_)(epoch) #endif // BITCOIN_UTIL_EPOCHGUARD_H |