mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
merge bitcoin#17073: PASTE macros to util/macros.h
This commit is contained in:
parent
138997c8e6
commit
4d6d3eb5a7
@ -265,6 +265,7 @@ BITCOIN_CORE_H = \
|
||||
util/fees.h \
|
||||
util/system.h \
|
||||
util/asmap.h \
|
||||
util/macros.h \
|
||||
util/memory.h \
|
||||
util/moneystr.h \
|
||||
util/string.h \
|
||||
|
@ -7,6 +7,7 @@
|
||||
#define BITCOIN_SYNC_H
|
||||
|
||||
#include <threadsafety.h>
|
||||
#include <util/macros.h>
|
||||
|
||||
#include <condition_variable>
|
||||
#include <thread>
|
||||
@ -183,9 +184,6 @@ public:
|
||||
template<typename MutexArg>
|
||||
using DebugLock = UniqueLock<typename std::remove_reference<typename std::remove_pointer<MutexArg>::type>::type>;
|
||||
|
||||
#define PASTE(x, y) x ## y
|
||||
#define PASTE2(x, y) PASTE(x, y)
|
||||
|
||||
#define LOCK(cs) DebugLock<decltype(cs)> PASTE2(criticalblock, __COUNTER__)(cs, #cs, __FILE__, __LINE__)
|
||||
#define LOCK2(cs1, cs2) \
|
||||
DebugLock<decltype(cs1)> criticalblock1(cs1, #cs1, __FILE__, __LINE__); \
|
||||
|
11
src/util/macros.h
Normal file
11
src/util/macros.h
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright (c) 2019 The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef BITCOIN_UTIL_MACROS_H
|
||||
#define BITCOIN_UTIL_MACROS_H
|
||||
|
||||
#define PASTE(x, y) x ## y
|
||||
#define PASTE2(x, y) PASTE(x, y)
|
||||
|
||||
#endif // BITCOIN_UTIL_MACROS_H
|
Loading…
Reference in New Issue
Block a user