Skip to content

Commit 8b77857

Browse files
committed
util: separate macros
1 parent dc4999c commit 8b77857

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

src/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ GRIDCOIN_CORE_H = \
177177
node/ui_interface.h \
178178
uint256.h \
179179
util/check.h \
180+
util/macros.h \
180181
util/reverse_iterator.h \
181182
util/settings.h \
182183
util/strencodings.h \

src/util/macros.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) 2019-2021 The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or https://www.opensource.org/licenses/mit-license.php.
4+
5+
#ifndef BITCOIN_UTIL_MACROS_H
6+
#define BITCOIN_UTIL_MACROS_H
7+
8+
#define PASTE(x, y) x ## y
9+
#define PASTE2(x, y) PASTE(x, y)
10+
11+
/**
12+
* Converts the parameter X to a string after macro replacement on X has been performed.
13+
* Don't merge these into one macro!
14+
*/
15+
#define STRINGIZE(X) DO_STRINGIZE(X)
16+
#define DO_STRINGIZE(X) #X
17+
18+
#endif // BITCOIN_UTIL_MACROS_H

test/lint/lint-includes.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ EXPECTED_BOOST_INCLUDES=(
6060
boost/multi_index/ordered_index.hpp
6161
boost/multi_index/sequenced_index.hpp
6262
boost/multi_index_container.hpp
63-
boost/preprocessor/cat.hpp
64-
boost/preprocessor/stringize.hpp
6563
boost/process.hpp
6664
boost/signals2/connection.hpp
6765
boost/signals2/optional_last_value.hpp

0 commit comments

Comments
 (0)