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.
This commit is contained in:
Carl Dong 2022-02-10 21:38:32 -05:00
parent 83a0bb7cc9
commit 1df44dd20c
3 changed files with 11 additions and 2 deletions

View File

@ -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 \

View File

@ -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

View File

@ -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;