Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F12428788
D12902.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D12902.diff
View Options
diff --git a/src/bench/bench.h b/src/bench/bench.h
--- a/src/bench/bench.h
+++ b/src/bench/bench.h
@@ -5,6 +5,8 @@
#ifndef BITCOIN_BENCH_BENCH_H
#define BITCOIN_BENCH_BENCH_H
+#include <util/macros.h>
+
#include <chrono>
#include <functional>
#include <map>
@@ -13,9 +15,6 @@
#include <bench/nanobench.h>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/stringize.hpp>
-
/*
* Usage:
@@ -60,9 +59,8 @@
};
} // namespace benchmark
-// BENCHMARK(foo) expands to: benchmark::BenchRunner bench_11foo("foo");
+// BENCHMARK(foo) expands to: benchmark::BenchRunner bench_11foo("foo", foo);
#define BENCHMARK(n) \
- benchmark::BenchRunner BOOST_PP_CAT(bench_, BOOST_PP_CAT(__LINE__, n))( \
- BOOST_PP_STRINGIZE(n), n);
+ benchmark::BenchRunner PASTE2(bench_, PASTE2(__LINE__, n))(STRINGIZE(n), n);
#endif // BITCOIN_BENCH_BENCH_H
diff --git a/src/clientversion.h b/src/clientversion.h
--- a/src/clientversion.h
+++ b/src/clientversion.h
@@ -6,6 +6,8 @@
#ifndef BITCOIN_CLIENTVERSION_H
#define BITCOIN_CLIENTVERSION_H
+#include <util/macros.h>
+
#if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#endif // HAVE_CONFIG_H
@@ -18,14 +20,6 @@
#error Client version information missing: version is not defined by bitcoin-config.h nor defined any other way
#endif
-/**
- * Converts the parameter X to a string after macro replacement on X has been
- * performed.
- * Don't merge these into one macro!
- */
-#define STRINGIZE(X) DO_STRINGIZE(X)
-#define DO_STRINGIZE(X) #X
-
//! Copyright string used in Windows .rc files
#define COPYRIGHT_STR \
"2009-" STRINGIZE(COPYRIGHT_YEAR) " " COPYRIGHT_HOLDERS_FINAL
diff --git a/src/util/macros.h b/src/util/macros.h
--- a/src/util/macros.h
+++ b/src/util/macros.h
@@ -8,4 +8,12 @@
#define PASTE(x, y) x##y
#define PASTE2(x, y) PASTE(x, y)
+/**
+ * Converts the parameter X to a string after macro replacement on X has been
+ * performed.
+ * Don't merge these into one macro!
+ */
+#define STRINGIZE(X) DO_STRINGIZE(X)
+#define DO_STRINGIZE(X) #X
+
#endif // BITCOIN_UTIL_MACROS_H
diff --git a/test/lint/lint-boost-dependencies.sh b/test/lint/lint-boost-dependencies.sh
--- a/test/lint/lint-boost-dependencies.sh
+++ b/test/lint/lint-boost-dependencies.sh
@@ -25,8 +25,6 @@
boost/multi_index/ordered_index.hpp
boost/multi_index/sequenced_index.hpp
boost/multi_index_container.hpp
- boost/preprocessor/cat.hpp
- boost/preprocessor/stringize.hpp
boost/range/iterator.hpp
boost/range/adaptor/sliced.hpp
boost/signals2/connection.hpp
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 28, 19:43 (7 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4844988
Default Alt Text
D12902.diff (2 KB)
Attached To
D12902: Drop boost/preprocessor dependencies
Event Timeline
Log In to Comment