From c72ef985778fa9992e4a7b4635a127ae127b36aa Mon Sep 17 00:00:00 2001 From: Just Wonder Date: Fri, 17 Jan 2020 16:14:42 -0800 Subject: [PATCH] Fixed MacOS Catalina build. --- src/Makefile.am | 2 +- src/qt/macdockiconhandler.mm | 11 ++++++++--- src/rpc/blockchain.cpp | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 59739b33f..8b978f41a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -357,7 +357,7 @@ libbitcoin_common_a_SOURCES = \ $(BITCOIN_CORE_H) # cnutils: shared between bitcoind, and bitcoin-qt and non-server tools -libbitcoin_cnutils_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/cn_utils -I$(srcdir)/cn_utils/contrib -I$(srcdir)/cn_utils/external/easylogging++ -I$(srcdir)/cn_utils/contrib/epee/include +libbitcoin_cnutils_a_CPPFLAGS = $(AM_CPPFLAGS) $(SSL_CFLAGS) -I$(srcdir)/cn_utils -I$(srcdir)/cn_utils/contrib -I$(srcdir)/cn_utils/external/easylogging++ -I$(srcdir)/cn_utils/contrib/epee/include libbitcoin_cnutils_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) libbitcoin_cnutils_a_CFLAGS = $(PIC_FLAGS) libbitcoin_cnutils_a_SOURCES = \ diff --git a/src/qt/macdockiconhandler.mm b/src/qt/macdockiconhandler.mm index 9e7de0f98..d37bd1da0 100644 --- a/src/qt/macdockiconhandler.mm +++ b/src/qt/macdockiconhandler.mm @@ -32,11 +32,16 @@ bool dockClickHandler(id self,SEL _cmd,...) { void setupDockClickHandler() { Class cls = objc_getClass("NSApplication"); - id appInst = objc_msgSend((id)cls, sel_registerName("sharedApplication")); + + // Fixed objc_msgSend mismatched arguments error. + typedef id (*send_type)(void*, SEL); + send_type typed_msgSend = (send_type)objc_msgSend; + + id appInst = typed_msgSend((id)cls, sel_registerName("sharedApplication")); if (appInst != nullptr) { - id delegate = objc_msgSend(appInst, sel_registerName("delegate")); - Class delClass = (Class)objc_msgSend(delegate, sel_registerName("class")); + id delegate = typed_msgSend(appInst, sel_registerName("delegate")); + Class delClass = (Class)typed_msgSend(delegate, sel_registerName("class")); SEL shouldHandle = sel_registerName("applicationShouldHandleReopen:hasVisibleWindows:"); if (class_getInstanceMethod(delClass, shouldHandle)) class_replaceMethod(delClass, shouldHandle, (IMP)dockClickHandler, "B@:"); diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 8f417e3ec..d4e2c9892 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1461,8 +1461,8 @@ UniValue get_info(const JSONRPCRequest& request) obj.push_back(Pair("mainnet", Params().NetworkIDString() == "main")); obj.push_back(Pair("testnet", Params().NetworkIDString() == "test")); obj.push_back(Pair("height", (int)chainActive.Height())); - obj.push_back(Pair("incoming_connections_count", g_connman->GetNodeCount(CConnman::CONNECTIONS_IN))); - obj.push_back(Pair("outgoing_connections_count", g_connman->GetNodeCount(CConnman::CONNECTIONS_OUT))); + obj.push_back(Pair("incoming_connections_count", (int)g_connman->GetNodeCount(CConnman::CONNECTIONS_IN))); + obj.push_back(Pair("outgoing_connections_count", (int)g_connman->GetNodeCount(CConnman::CONNECTIONS_OUT))); obj.push_back(Pair("difficulty", (uint64_t)round(GetDifficulty()))); obj.push_back(Pair("tx_pool_size", (int64_t) mempool.size())); obj.push_back(Pair("status", "OK"));