diff options
Diffstat (limited to '3rdParty/Boost/src/boost/asio/ip/host_name.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/asio/ip/host_name.hpp | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/3rdParty/Boost/src/boost/asio/ip/host_name.hpp b/3rdParty/Boost/src/boost/asio/ip/host_name.hpp index fee245b..f40a9df 100644 --- a/3rdParty/Boost/src/boost/asio/ip/host_name.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/host_name.hpp @@ -1,6 +1,6 @@ // -// host_name.hpp -// ~~~~~~~~~~~~~ +// ip/host_name.hpp +// ~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // @@ -15,45 +15,21 @@ # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) -#include <boost/asio/detail/push_options.hpp> - -#include <boost/asio/detail/push_options.hpp> +#include <boost/asio/detail/config.hpp> #include <string> -#include <boost/asio/detail/pop_options.hpp> +#include <boost/system/error_code.hpp> -#include <boost/asio/error.hpp> -#include <boost/asio/detail/socket_ops.hpp> -#include <boost/asio/detail/throw_error.hpp> +#include <boost/asio/detail/push_options.hpp> namespace boost { namespace asio { namespace ip { /// Get the current host name. -std::string host_name(); +BOOST_ASIO_DECL std::string host_name(); /// Get the current host name. -std::string host_name(boost::system::error_code& ec); - -inline std::string host_name() -{ - char name[1024]; - boost::system::error_code ec; - if (boost::asio::detail::socket_ops::gethostname(name, sizeof(name), ec) != 0) - { - boost::asio::detail::throw_error(ec); - return std::string(); - } - return std::string(name); -} - -inline std::string host_name(boost::system::error_code& ec) -{ - char name[1024]; - if (boost::asio::detail::socket_ops::gethostname(name, sizeof(name), ec) != 0) - return std::string(); - return std::string(name); -} +BOOST_ASIO_DECL std::string host_name(boost::system::error_code& ec); } // namespace ip } // namespace asio @@ -61,4 +37,8 @@ inline std::string host_name(boost::system::error_code& ec) #include <boost/asio/detail/pop_options.hpp> +#if defined(BOOST_ASIO_HEADER_ONLY) +# include <boost/asio/ip/impl/host_name.ipp> +#endif // defined(BOOST_ASIO_HEADER_ONLY) + #endif // BOOST_ASIO_IP_HOST_NAME_HPP |