diff --git a/src/bench/bench_bitcoin.cpp b/src/bench/bench_bitcoin.cpp index a20a67f9e..c59881f41 100644 --- a/src/bench/bench_bitcoin.cpp +++ b/src/bench/bench_bitcoin.cpp @@ -11,6 +11,8 @@ #include "librustzcash.h" +const std::function G_TRANSLATION_FUN = nullptr; + int main(int argc, char** argv) { diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 0b695303b..eebd097c4 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -19,6 +19,8 @@ #include +const std::function G_TRANSLATION_FUN = nullptr; + static const char DEFAULT_RPCCONNECT[] = "127.0.0.1"; static const int DEFAULT_HTTP_CLIENT_TIMEOUT=900; static const int CONTINUE_EXECUTION=-1; diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 04e02d3d1..c5859b9c5 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -27,6 +27,8 @@ static bool fCreateBlank; static std::map registers; static const int CONTINUE_EXECUTION=-1; +const std::function G_TRANSLATION_FUN = nullptr; + // // This function returns either one of EXIT_ codes when it's expected to stop the process or // CONTINUE_EXECUTION when it's expected to continue further. diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 7cc186387..265dc9b5f 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -19,6 +19,8 @@ #include +const std::function G_TRANSLATION_FUN = nullptr; + /* Introduction text for doxygen: */ /*! \mainpage Developer documentation diff --git a/src/consensus/params.h b/src/consensus/params.h index 2cf22f576..eb4874710 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -12,6 +12,7 @@ #include #include +#include namespace Consensus { diff --git a/src/dbwrapper.cpp b/src/dbwrapper.cpp index aeddcead8..d36afb477 100644 --- a/src/dbwrapper.cpp +++ b/src/dbwrapper.cpp @@ -13,6 +13,8 @@ #include #include +#include + static leveldb::Options GetOptions(size_t nCacheSize) { leveldb::Options options; diff --git a/src/gtest/main.cpp b/src/gtest/main.cpp index ea33fe46a..3cd68c7fe 100644 --- a/src/gtest/main.cpp +++ b/src/gtest/main.cpp @@ -6,6 +6,8 @@ #include "librustzcash.h" +const std::function G_TRANSLATION_FUN = nullptr; + struct ECCryptoClosure { ECCVerifyHandle handle; diff --git a/src/miner.h b/src/miner.h index 0fa2dbb33..c2f3e05cd 100644 --- a/src/miner.h +++ b/src/miner.h @@ -9,6 +9,7 @@ #include "primitives/block.h" #include +#include #include class CBlockIndex; diff --git a/src/noui.cpp b/src/noui.cpp index a5ecd9f27..83ca8b4a6 100644 --- a/src/noui.cpp +++ b/src/noui.cpp @@ -12,6 +12,8 @@ #include #include +#include + static bool noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style) { bool fSecure = style & CClientUIInterface::SECURE; diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 0baba7a8c..11cb1b674 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -31,6 +31,8 @@ #include "librustzcash.h" +const std::function G_TRANSLATION_FUN = nullptr; + CClientUIInterface uiInterface; // Declared but not defined in ui_interface.h TracingHandle* pTracingHandle = nullptr; diff --git a/src/util.cpp b/src/util.cpp index 62d1427c9..0ee2979bd 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -105,8 +105,6 @@ bool fDebug = false; bool fDaemon = false; bool fServer = false; -CTranslationInterface translationInterface; - /** Interpret string as boolean, for argument parsing */ static bool InterpretBool(const std::string& strValue) { diff --git a/src/util.h b/src/util.h index c9304a788..88b15b562 100644 --- a/src/util.h +++ b/src/util.h @@ -27,37 +27,28 @@ #include #include -#include #include -/** Signals for translation. */ -class CTranslationInterface -{ -public: - /** Translate a message to the native language of the user. */ - boost::signals2::signal Translate; -}; - extern std::map mapArgs; extern std::map > mapMultiArgs; extern bool fDebug; extern bool fServer; -extern CTranslationInterface translationInterface; - [[noreturn]] extern void new_handler_terminate(); extern const char * const BITCOIN_CONF_FILENAME; extern const char * const BITCOIN_PID_FILENAME; +/** Translate a message to the native language of the user. */ +const extern std::function G_TRANSLATION_FUN; + /** - * Translation function: Call Translate signal on UI interface, which returns a boost::optional result. - * If no translation slot is registered, nothing is returned, and simply return the input. + * Translation function. + * If no translation function is set, simply return the input. */ inline std::string _(const char* psz) { - boost::optional rv = translationInterface.Translate(psz); - return rv ? (*rv) : psz; + return G_TRANSLATION_FUN ? (G_TRANSLATION_FUN)(psz) : psz; } void SetupEnvironment(); diff --git a/src/zcash/Proof.hpp b/src/zcash/Proof.hpp index 28cdf0cc2..0b9855f63 100644 --- a/src/zcash/Proof.hpp +++ b/src/zcash/Proof.hpp @@ -4,6 +4,8 @@ #include "serialize.h" #include "uint256.h" +#include + namespace libzcash { const unsigned char G1_PREFIX_MASK = 0x02; diff --git a/test/lint/lint-includes.sh b/test/lint/lint-includes.sh index ea00d0def..6e11352d8 100755 --- a/test/lint/lint-includes.sh +++ b/test/lint/lint-includes.sh @@ -80,6 +80,7 @@ EXPECTED_BOOST_INCLUDES=( boost/scope_exit.hpp boost/scoped_ptr.hpp boost/shared_ptr.hpp + boost/signals2/connection.hpp boost/signals2/last_value.hpp boost/signals2/signal.hpp boost/test/data/test_case.hpp