Integrate various fixes so Novacoin builds on OSX 2/head
authorJulian Yap <julian@ehawaii.gov>
Thu, 13 Feb 2014 03:58:31 +0000 (17:58 -1000)
committerJulian Yap <julian@ehawaii.gov>
Thu, 13 Feb 2014 03:58:31 +0000 (17:58 -1000)
src/makefile.osx
src/net.cpp
src/serialize.h

index abead78..8559cdf 100644 (file)
@@ -63,6 +63,7 @@ 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 \
@@ -130,7 +131,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; cd ..
+       @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(CFLAGS)" libleveldb.a libmemenv.a && cd ..
 obj/txdb-leveldb.o: leveldb/libleveldb.a
 
 # auto-generated dependencies:
@@ -171,5 +172,6 @@ clean:
        -rm -f obj/*.P
        -rm -f obj/zerocoin/*.P
        -rm -f obj/build.h
+       -cd leveldb && $(MAKE) clean || true
 
 FORCE:
index 027a1ef..d6b3118 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;
-array<int, THREAD_MAX> vnThreadsRunning;
+boost::array<int, THREAD_MAX> vnThreadsRunning;
 static std::vector<SOCKET> vhListenSocket;
 CAddrMan addrman;
 
index 3b3dcd4..44eb4f5 100644 (file)
@@ -824,18 +824,6 @@ 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)