Merge pull request #17 from erkmos/macfixes

removed redundant insert and added a missing define on mac os x
This commit is contained in:
Pieter Wuille 2014-03-24 22:25:57 +01:00
commit 7fedc639db
2 changed files with 3 additions and 12 deletions

View file

@ -26,6 +26,9 @@
#endif #endif
typedef u_int SOCKET; typedef u_int SOCKET;
#ifdef __APPLE__
#define MSG_NOSIGNAL 0
#endif
#ifdef WIN32 #ifdef WIN32
#define MSG_NOSIGNAL 0 #define MSG_NOSIGNAL 0
#define MSG_DONTWAIT 0 #define MSG_DONTWAIT 0

View file

@ -932,18 +932,6 @@ public:
iterator insert(iterator it, const char& x=char()) { return vch.insert(it, x); } iterator insert(iterator it, const char& x=char()) { return vch.insert(it, x); }
void insert(iterator it, size_type n, const char& x) { vch.insert(it, n, x); } void insert(iterator it, size_type n, const char& x) { vch.insert(it, n, x); }
void insert(iterator it, const_iterator first, const_iterator last)
{
if (it == vch.begin() + nReadPos && 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);
}
void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::const_iterator last) void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::const_iterator last)
{ {
if (it == vch.begin() + nReadPos && last - first <= nReadPos) if (it == vch.begin() + nReadPos && last - first <= nReadPos)