From 0048efea8dd87e9655bd0ff535c881885496c4f0 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Fri, 27 Sep 2013 07:14:20 -0700 Subject: [PATCH] Fixes for FreeBSD --- src/ripple/http/api/Session.h | 2 +- src/ripple/http/impl/Peer.h | 4 ++-- src/ripple/types/api/IdentifierType.h | 6 ++++++ src/ripple/types/api/base_uint.h | 6 ++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/ripple/http/api/Session.h b/src/ripple/http/api/Session.h index 45babf2e5..43ce84bd7 100644 --- a/src/ripple/http/api/Session.h +++ b/src/ripple/http/api/Session.h @@ -65,7 +65,7 @@ public: void write (std::string const& s) { if (! s.empty()) - write (&s.front(), + write (&s[0], std::distance (s.begin(), s.end())); } diff --git a/src/ripple/http/impl/Peer.h b/src/ripple/http/impl/Peer.h index 8ef393c1c..7f810a586 100644 --- a/src/ripple/http/impl/Peer.h +++ b/src/ripple/http/impl/Peer.h @@ -147,7 +147,7 @@ public: m_parser.request()->body ()); s.resize (body.size ()); boost::asio::buffer_copy ( - boost::asio::buffer (&s.front(), + boost::asio::buffer (&s[0], s.size()), body.data()); return s; } @@ -482,7 +482,7 @@ public: // count will drop to zero and the buffer will be freed. // boost::asio::async_write (*m_socket, - boost::asio::const_buffers_1 (&buf->front(), buf->size()), + boost::asio::const_buffers_1 (&(*buf)[0], buf->size()), m_strand.wrap (boost::bind (&Peer::handle_write, Ptr (this), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred, diff --git a/src/ripple/types/api/IdentifierType.h b/src/ripple/types/api/IdentifierType.h index 699bd28c5..c0ff0b774 100644 --- a/src/ripple/types/api/IdentifierType.h +++ b/src/ripple/types/api/IdentifierType.h @@ -213,6 +213,9 @@ std::istream& operator>> (std::istream& is, namespace std { +template +struct hash; + /** Specialization for hash. */ template struct hash > @@ -244,6 +247,9 @@ private: //------------------------------------------------------------------------------ +template +struct equal_to; + /** Specialization for equal_to. */ template struct equal_to > diff --git a/src/ripple/types/api/base_uint.h b/src/ripple/types/api/base_uint.h index ac400d0ce..cca84a990 100644 --- a/src/ripple/types/api/base_uint.h +++ b/src/ripple/types/api/base_uint.h @@ -500,6 +500,9 @@ std::ostream& operator<< (std::ostream& out, const base_uint& u) namespace std { +template +struct hash; + /** Specialization for hash. */ template struct hash > @@ -530,6 +533,9 @@ private: //------------------------------------------------------------------------------ +template +struct equal_to; + /** Specialization for equal_to. */ template struct equal_to >