Boost logo

Boost-Commit :

From: chris_at_[hidden]
Date: 2007-10-17 10:04:42


Author: chris_kohlhoff
Date: 2007-10-17 10:04:42 EDT (Wed, 17 Oct 2007)
New Revision: 40119
URL: http://svn.boost.org/trac/boost/changeset/40119

Log:
Add dummy enum for ssl errors. Change to static const references to error
category objects to be consistent with boost.system.

Text files modified:
   trunk/boost/asio/error.hpp | 34 ++++++++++++++--------------------
   1 files changed, 14 insertions(+), 20 deletions(-)

Modified: trunk/boost/asio/error.hpp
==============================================================================
--- trunk/boost/asio/error.hpp (original)
+++ trunk/boost/asio/error.hpp 2007-10-17 10:04:42 EDT (Wed, 17 Oct 2007)
@@ -198,6 +198,10 @@
   not_found
 };
 
+enum ssl_errors
+{
+};
+
 namespace detail {
 
 inline const boost::system::error_category& get_system_category()
@@ -321,8 +325,6 @@
 
 } // namespace detail
 
-#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
-
 static const boost::system::error_category& system_category
   = boost::asio::error::detail::get_system_category();
 static const boost::system::error_category& netdb_category
@@ -334,24 +336,6 @@
 static const boost::system::error_category& ssl_category
   = boost::asio::error::detail::get_ssl_category();
 
-#else
-
-namespace
-{
- const boost::system::error_category& system_category
- = boost::asio::error::detail::get_system_category();
- const boost::system::error_category& netdb_category
- = boost::asio::error::detail::get_netdb_category();
- const boost::system::error_category& addrinfo_category
- = boost::asio::error::detail::get_addrinfo_category();
- const boost::system::error_category& misc_category
- = boost::asio::error::detail::get_misc_category();
- const boost::system::error_category& ssl_category
- = boost::asio::error::detail::get_ssl_category();
-} // namespace
-
-#endif
-
 } // namespace error
 } // namespace asio
 
@@ -377,6 +361,11 @@
   static const bool value = true;
 };
 
+template<> struct is_error_code_enum<boost::asio::error::ssl_errors>
+{
+ static const bool value = true;
+};
+
 } // namespace system
 
 namespace asio {
@@ -402,6 +391,11 @@
   return boost::system::error_code(static_cast<int>(e), misc_category);
 }
 
+inline boost::system::error_code make_error_code(ssl_errors e)
+{
+ return boost::system::error_code(static_cast<int>(e), ssl_category);
+}
+
 } // namespace error
 } // namespace asio
 } // namespace boost


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk