From 2bb194b8d6bd1137877bbb34830c8f56967846dd Mon Sep 17 00:00:00 2001 From: MASM fan Date: Fri, 14 Feb 2014 15:07:21 +0400 Subject: [PATCH] Revert "Merge pull request #2 from jyap808/osx_build_fixes" This reverts commit 5c70a86460b12e92be520ae8ee501101f68856cc, reversing changes made to cf882ecd08d63682370e8e928a63ed51b9aa6734. --- src/makefile.osx | 4 +--- src/net.cpp | 2 +- src/serialize.h | 12 ++++++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/makefile.osx b/src/makefile.osx index 8559cdf..abead78 100644 --- a/src/makefile.osx +++ b/src/makefile.osx @@ -63,7 +63,6 @@ CFLAGS += -Wall -Wextra -Wformat -Wno-ignored-qualifiers -Wformat-security -Wno- $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) OBJS= \ - leveldb/libleveldb.a \ obj/alert.o \ obj/version.o \ obj/checkpoints.o \ @@ -131,7 +130,7 @@ DEFS += $(addprefix -I,$(CURDIR)/leveldb/include) DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers) OBJS += obj/txdb-leveldb.o leveldb/libleveldb.a: - @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(CFLAGS)" libleveldb.a libmemenv.a && cd .. + @echo "Building LevelDB ..."; cd leveldb; make; cd .. obj/txdb-leveldb.o: leveldb/libleveldb.a # auto-generated dependencies: @@ -172,6 +171,5 @@ clean: -rm -f obj/*.P -rm -f obj/zerocoin/*.P -rm -f obj/build.h - -cd leveldb && $(MAKE) clean || true FORCE: diff --git a/src/net.cpp b/src/net.cpp index d6b3118..027a1ef 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -57,7 +57,7 @@ static bool vfLimited[NET_MAX] = {}; static CNode* pnodeLocalHost = NULL; CAddress addrSeenByPeer(CService("0.0.0.0", 0), nLocalServices); uint64 nLocalHostNonce = 0; -boost::array vnThreadsRunning; +array vnThreadsRunning; static std::vector vhListenSocket; CAddrMan addrman; diff --git a/src/serialize.h b/src/serialize.h index 44eb4f5..3b3dcd4 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -824,6 +824,18 @@ public: vch.insert(it, first, last); } + void insert(iterator it, std::vector::const_iterator first, std::vector::const_iterator last) + { + assert(last - first >= 0); + if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos) + { + // special case for inserting at the front when there's room + nReadPos -= (last - first); + memcpy(&vch[nReadPos], &first[0], last - first); + } + else + vch.insert(it, first, last); + } #if !defined(_MSC_VER) || _MSC_VER >= 1300 void insert(iterator it, const char* first, const char* last) -- 1.7.1