Revert "Merge pull request #2 from jyap808/osx_build_fixes"
authorMASM fan <masmfan@gmail.com>
Fri, 14 Feb 2014 11:07:21 +0000 (15:07 +0400)
committerMASM fan <masmfan@gmail.com>
Fri, 14 Feb 2014 11:07:21 +0000 (15:07 +0400)
This reverts commit 5c70a86460b12e92be520ae8ee501101f68856cc, reversing
changes made to cf882ecd08d63682370e8e928a63ed51b9aa6734.

src/makefile.osx
src/net.cpp
src/serialize.h

index 8559cdf..abead78 100644 (file)
@@ -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:
index d6b3118..027a1ef 100644 (file)
@@ -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<int, THREAD_MAX> vnThreadsRunning;
+array<int, THREAD_MAX> vnThreadsRunning;
 static std::vector<SOCKET> vhListenSocket;
 CAddrMan addrman;
 
index 44eb4f5..3b3dcd4 100644 (file)
@@ -824,6 +824,18 @@ public:
             vch.insert(it, first, last);
     }
 
+    void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::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)