summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-11-24 20:33:19 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-11-24 20:35:17 (GMT)
commit332d60c56dfaa11fdd135088279d15cd5983b3d4 (patch)
treedd77717a4e1732da929d5ff8a0471fa3f005e201 /3rdParty/Boost/src/boost/asio/error.hpp
parent90c44a10fec26d2a0935b2d62e82b6a5be028373 (diff)
downloadswift-contrib-332d60c56dfaa11fdd135088279d15cd5983b3d4.zip
swift-contrib-332d60c56dfaa11fdd135088279d15cd5983b3d4.tar.bz2
Upgraded Boost to 1.45.0.
Diffstat (limited to '3rdParty/Boost/src/boost/asio/error.hpp')
-rw-r--r--3rdParty/Boost/src/boost/asio/error.hpp145
1 files changed, 23 insertions, 122 deletions
diff --git a/3rdParty/Boost/src/boost/asio/error.hpp b/3rdParty/Boost/src/boost/asio/error.hpp
index 0dcb3dc..569ad80 100644
--- a/3rdParty/Boost/src/boost/asio/error.hpp
+++ b/3rdParty/Boost/src/boost/asio/error.hpp
@@ -15,15 +15,15 @@
# 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/config.hpp>
+#include <boost/asio/detail/config.hpp>
#include <boost/cerrno.hpp>
#include <boost/system/error_code.hpp>
-#include <boost/asio/detail/pop_options.hpp>
-
-#include <boost/asio/detail/socket_types.hpp>
+#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# include <winerror.h>
+#else
+# include <cerrno>
+# include <netdb.h>
+#endif
#if defined(GENERATING_DOCUMENTATION)
/// INTERNAL ONLY.
@@ -50,6 +50,8 @@
# define BOOST_ASIO_WIN_OR_POSIX(e_win, e_posix) e_posix
#endif
+#include <boost/asio/detail/push_options.hpp>
+
namespace boost {
namespace asio {
namespace error {
@@ -215,70 +217,16 @@ enum ssl_errors
inline const boost::system::error_category& get_system_category()
{
- return boost::system::get_system_category();
+ return boost::system::system_category();
}
#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-namespace detail {
-
-class netdb_category : public boost::system::error_category
-{
-public:
- const char* name() const
- {
- return "asio.netdb";
- }
-
- std::string message(int value) const
- {
- if (value == error::host_not_found)
- return "Host not found (authoritative)";
- if (value == error::host_not_found_try_again)
- return "Host not found (non-authoritative), try again later";
- if (value == error::no_data)
- return "The query is valid, but it does not have associated data";
- if (value == error::no_recovery)
- return "A non-recoverable error occurred during database lookup";
- return "asio.netdb error";
- }
-};
-
-} // namespace detail
-
-inline const boost::system::error_category& get_netdb_category()
-{
- static detail::netdb_category instance;
- return instance;
-}
+extern BOOST_ASIO_DECL
+const boost::system::error_category& get_netdb_category();
-namespace detail {
-
-class addrinfo_category : public boost::system::error_category
-{
-public:
- const char* name() const
- {
- return "asio.addrinfo";
- }
-
- std::string message(int value) const
- {
- if (value == error::service_not_found)
- return "Service not found";
- if (value == error::socket_type_not_supported)
- return "Socket type not supported";
- return "asio.addrinfo error";
- }
-};
-
-} // namespace detail
-
-inline const boost::system::error_category& get_addrinfo_category()
-{
- static detail::addrinfo_category instance;
- return instance;
-}
+extern BOOST_ASIO_DECL
+const boost::system::error_category& get_addrinfo_category();
#else // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
@@ -294,61 +242,11 @@ inline const boost::system::error_category& get_addrinfo_category()
#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-namespace detail {
-
-class misc_category : public boost::system::error_category
-{
-public:
- const char* name() const
- {
- return "asio.misc";
- }
-
- std::string message(int value) const
- {
- if (value == error::already_open)
- return "Already open";
- if (value == error::eof)
- return "End of file";
- if (value == error::not_found)
- return "Element not found";
- if (value == error::fd_set_failure)
- return "The descriptor does not fit into the select call's fd_set";
- return "asio.misc error";
- }
-};
+extern BOOST_ASIO_DECL
+const boost::system::error_category& get_misc_category();
-} // namespace detail
-
-inline const boost::system::error_category& get_misc_category()
-{
- static detail::misc_category instance;
- return instance;
-}
-
-namespace detail {
-
-class ssl_category : public boost::system::error_category
-{
-public:
- const char* name() const
- {
- return "asio.ssl";
- }
-
- std::string message(int) const
- {
- return "asio.ssl error";
- }
-};
-
-} // namespace detail
-
-inline const boost::system::error_category& get_ssl_category()
-{
- static detail::ssl_category instance;
- return instance;
-}
+extern BOOST_ASIO_DECL
+const boost::system::error_category& get_ssl_category();
static const boost::system::error_category& system_category
= boost::asio::error::get_system_category();
@@ -430,13 +328,16 @@ inline boost::system::error_code make_error_code(ssl_errors e)
} // namespace asio
} // namespace boost
+#include <boost/asio/detail/pop_options.hpp>
+
#undef BOOST_ASIO_NATIVE_ERROR
#undef BOOST_ASIO_SOCKET_ERROR
#undef BOOST_ASIO_NETDB_ERROR
#undef BOOST_ASIO_GETADDRINFO_ERROR
#undef BOOST_ASIO_WIN_OR_POSIX
-
-#include <boost/asio/detail/pop_options.hpp>
+#if defined(BOOST_ASIO_HEADER_ONLY)
+# include <boost/asio/impl/error.ipp>
+#endif // defined(BOOST_ASIO_HEADER_ONLY)
#endif // BOOST_ASIO_ERROR_HPP