From 9dadba6b0940dcd476b5219ee3de942bf37a15c7 Mon Sep 17 00:00:00 2001 From: Sami Ahmed Date: Thu, 19 Mar 2026 02:46:37 -0700 Subject: [PATCH] Fix build: tuple access syntax, namespace, LZ4 separate compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - miner.cpp: .get() → std::get() (boost::tuple member syntax doesn't exist on std::tuple) - script.cpp: remove 'using namespace boost' (no boost headers left) - smessage.cpp: include lz4/lz4.h instead of lz4/lz4.c (U64 typedef conflict with xxhash when LZ4 1.10.0 source included in same TU) - makefile.unix: add obj/lz4.o as separate compilation unit - triangles-qt.pro: add src/lz4/lz4.c to SOURCES Co-Authored-By: Claude Opus 4.6 --- src/makefile.unix | 8 ++++++++ src/miner.cpp | 18 +++++++++--------- src/script.cpp | 1 - src/smessage.cpp | 2 +- triangles-qt.pro | 1 + 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/makefile.unix b/src/makefile.unix index 0648289..dbcebbe 100644 --- a/src/makefile.unix +++ b/src/makefile.unix @@ -170,6 +170,7 @@ OBJS= \ obj/scrypt-x86.o \ obj/scrypt-x86_64.o \ obj/smessage.o \ + obj/lz4.o \ obj/onion_v3.o \ obj/tor_process.o \ obj/tor_embed_hooks.o \ @@ -243,6 +244,13 @@ obj/%.o: %.c -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \ rm -f $(@:%.o=%.d) +obj/lz4.o: lz4/lz4.c + $(CXX) -c $(xCXXFLAGS) -fpermissive -MMD -MF $(@:%.o=%.d) -o $@ $< + @cp $(@:%.o=%.d) $(@:%.o=%.P); \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//'\ + -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \ + rm -f $(@:%.o=%.d) + obj/tor_embed_hooks.o: tor_embed_hooks.cpp $(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $< @cp $(@:%.o=%.d) $(@:%.o=%.P); \ diff --git a/src/miner.cpp b/src/miner.cpp index c782ed6..050d001 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -93,15 +93,15 @@ public: { if (byFee) { - if (a.get<1>() == b.get<1>()) - return a.get<0>() < b.get<0>(); - return a.get<1>() < b.get<1>(); + if (std::get<1>(a) == std::get<1>(b)) + return std::get<0>(a) < std::get<0>(b); + return std::get<1>(a) < std::get<1>(b); } else { - if (a.get<0>() == b.get<0>()) - return a.get<1>() < b.get<1>(); - return a.get<0>() < b.get<0>(); + if (std::get<0>(a) == std::get<0>(b)) + return std::get<1>(a) < std::get<1>(b); + return std::get<0>(a) < std::get<0>(b); } } }; @@ -259,9 +259,9 @@ CBlock* CreateNewBlock(CWallet* pwallet, bool fProofOfStake, int64_t* pFees) while (!vecPriority.empty()) { // Take highest priority transaction off the priority queue: - double dPriority = vecPriority.front().get<0>(); - double dFeePerKb = vecPriority.front().get<1>(); - CTransaction& tx = *(vecPriority.front().get<2>()); + double dPriority = std::get<0>(vecPriority.front()); + double dFeePerKb = std::get<1>(vecPriority.front()); + CTransaction& tx = *(std::get<2>(vecPriority.front())); std::pop_heap(vecPriority.begin(), vecPriority.end(), comparer); vecPriority.pop_back(); diff --git a/src/script.cpp b/src/script.cpp index 9c1d827..827c072 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -6,7 +6,6 @@ #include using namespace std; -using namespace boost; #include "script.h" #include "keystore.h" diff --git a/src/smessage.cpp b/src/smessage.cpp index b58b464..60ed105 100644 --- a/src/smessage.cpp +++ b/src/smessage.cpp @@ -54,7 +54,7 @@ Notes: #include "txdb.h" -#include "lz4/lz4.c" +#include "lz4/lz4.h" #include "xxhash/xxhash.h" #include "xxhash/xxhash.c" diff --git a/triangles-qt.pro b/triangles-qt.pro index 70ad316..40ce84a 100644 --- a/triangles-qt.pro +++ b/triangles-qt.pro @@ -331,6 +331,7 @@ SOURCES += src/qt/triangles.cpp src/qt/trianglesgui.cpp \ src/version.cpp \ src/sync.cpp \ src/smessage.cpp \ + src/lz4/lz4.c \ src/util.cpp \ src/netbase.cpp \ src/key.cpp \