diff options
author | Carl Dong <contact@carldong.me> | 2022-02-10 21:38:32 -0500 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2022-04-26 16:30:53 -0400 |
commit | 1df44dd20ca9e6e55eb353824b27d11bd1878c59 (patch) | |
tree | 0d8eb87fe824cc6b493511570e8bba96f2acdc5b | |
parent | 83a0bb7cc9907dbe089409ed5a417277ed63ed95 (diff) | |
download | bitcoin-1df44dd20ca9e6e55eb353824b27d11bd1878c59.tar.xz |
b-cs: Define G_TRANSLATION_FUN in bitcoinkernel.cpp
[META] This is done in preparation for extracting libbitcoinkernel in a
following commit. It seems logical that generally users of a
library shouldn't need to export its own symbols to use the
library.
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/bitcoin-chainstate.cpp | 2 | ||||
-rw-r--r-- | src/kernel/bitcoinkernel.cpp | 10 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index d074e6314e..11fded3c2e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -800,6 +800,7 @@ bitcoin_util_LDADD = \ # bitcoin-chainstate binary # bitcoin_chainstate_SOURCES = \ bitcoin-chainstate.cpp \ + kernel/bitcoinkernel.cpp \ arith_uint256.cpp \ blockfilter.cpp \ chain.cpp \ diff --git a/src/bitcoin-chainstate.cpp b/src/bitcoin-chainstate.cpp index fcbb6aacce..81e8dfd9a0 100644 --- a/src/bitcoin-chainstate.cpp +++ b/src/bitcoin-chainstate.cpp @@ -28,8 +28,6 @@ #include <functional> #include <iosfwd> -const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr; - int main(int argc, char* argv[]) { // SETUP: Argument parsing and handling diff --git a/src/kernel/bitcoinkernel.cpp b/src/kernel/bitcoinkernel.cpp new file mode 100644 index 0000000000..bb101ba186 --- /dev/null +++ b/src/kernel/bitcoinkernel.cpp @@ -0,0 +1,10 @@ +// Copyright (c) 2022 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include <functional> +#include <string> + +// Define G_TRANSLATION_FUN symbol in libbitcoinkernel library so users of the +// library aren't required to export this symbol +extern const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr; |