summaryrefslogtreecommitdiff
path: root/boost/asio/ip/impl/address_v4.ipp
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
committerChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
commit08c1e93fa36a49f49325a07fe91ff92c964c2b6c (patch)
tree7a7053ceb8874b28ec4b868d4c49b500008a102e /boost/asio/ip/impl/address_v4.ipp
parentbb4dd8289b351fae6b55e303f189127a394a1edd (diff)
downloadboost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.gz
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.bz2
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.zip
Imported Upstream version 1.57.0upstream/1.57.0
Diffstat (limited to 'boost/asio/ip/impl/address_v4.ipp')
-rw-r--r--boost/asio/ip/impl/address_v4.ipp16
1 files changed, 9 insertions, 7 deletions
diff --git a/boost/asio/ip/impl/address_v4.ipp b/boost/asio/ip/impl/address_v4.ipp
index 31f6e27d59..a2029016b3 100644
--- a/boost/asio/ip/impl/address_v4.ipp
+++ b/boost/asio/ip/impl/address_v4.ipp
@@ -2,7 +2,7 @@
// ip/impl/address_v4.ipp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,10 +18,10 @@
#include <boost/asio/detail/config.hpp>
#include <climits>
#include <stdexcept>
-#include <boost/throw_exception.hpp>
#include <boost/asio/error.hpp>
#include <boost/asio/detail/socket_ops.hpp>
#include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
#include <boost/asio/ip/address_v4.hpp>
#include <boost/asio/detail/push_options.hpp>
@@ -37,7 +37,7 @@ address_v4::address_v4(const address_v4::bytes_type& bytes)
|| bytes[2] > 0xFF || bytes[3] > 0xFF)
{
std::out_of_range ex("address_v4 from bytes_type");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
}
#endif // UCHAR_MAX > 0xFF
@@ -51,11 +51,12 @@ address_v4::address_v4(unsigned long addr)
if (addr > 0xFFFFFFFF)
{
std::out_of_range ex("address_v4 from unsigned long");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
}
#endif // ULONG_MAX > 0xFFFFFFFF
- addr_.s_addr = boost::asio::detail::socket_ops::host_to_network_long(addr);
+ addr_.s_addr = boost::asio::detail::socket_ops::host_to_network_long(
+ static_cast<boost::asio::detail::u_long_type>(addr));
}
address_v4::bytes_type address_v4::to_bytes() const
@@ -87,7 +88,8 @@ std::string address_v4::to_string(boost::system::error_code& ec) const
{
char addr_str[boost::asio::detail::max_addr_v4_str_len];
const char* addr =
- boost::asio::detail::socket_ops::inet_ntop(AF_INET, &addr_, addr_str,
+ boost::asio::detail::socket_ops::inet_ntop(
+ BOOST_ASIO_OS_DEF(AF_INET), &addr_, addr_str,
boost::asio::detail::max_addr_v4_str_len, 0, ec);
if (addr == 0)
return std::string();
@@ -107,7 +109,7 @@ address_v4 address_v4::from_string(
{
address_v4 tmp;
if (boost::asio::detail::socket_ops::inet_pton(
- AF_INET, str, &tmp.addr_, 0, ec) <= 0)
+ BOOST_ASIO_OS_DEF(AF_INET), str, &tmp.addr_, 0, ec) <= 0)
return address_v4();
return tmp;
}