From 1df44dd20ca9e6e55eb353824b27d11bd1878c59 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Thu, 10 Feb 2022 21:38:32 -0500 Subject: [PATCH] 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. --- src/Makefile.am | 1 + src/bitcoin-chainstate.cpp | 2 -- src/kernel/bitcoinkernel.cpp | 10 ++++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/kernel/bitcoinkernel.cpp diff --git a/src/Makefile.am b/src/Makefile.am index d074e6314eb..11fded3c2e9 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 fcbb6aaccee..81e8dfd9a0c 100644 --- a/src/bitcoin-chainstate.cpp +++ b/src/bitcoin-chainstate.cpp @@ -28,8 +28,6 @@ #include #include -const std::function 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 00000000000..bb101ba186a --- /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 +#include + +// Define G_TRANSLATION_FUN symbol in libbitcoinkernel library so users of the +// library aren't required to export this symbol +extern const std::function G_TRANSLATION_FUN = nullptr;