|
Boost-Commit : |
From: chris_at_[hidden]
Date: 2007-08-20 10:11:47
Author: chris_kohlhoff
Date: 2007-08-20 10:11:46 EDT (Mon, 20 Aug 2007)
New Revision: 38786
URL: http://svn.boost.org/trac/boost/changeset/38786
Log:
Fix order of initialisation problem with error categories.
Text files modified:
trunk/boost/asio/error.hpp | 48 ++++++++++++++++++++++++++-------------
trunk/boost/asio/ssl/detail/openssl_operation.hpp | 2
2 files changed, 33 insertions(+), 17 deletions(-)
Modified: trunk/boost/asio/error.hpp
==============================================================================
--- trunk/boost/asio/error.hpp (original)
+++ trunk/boost/asio/error.hpp 2007-08-20 10:11:46 EDT (Mon, 20 Aug 2007)
@@ -51,7 +51,7 @@
boost::system::native_ecat)
# define BOOST_ASIO_MISC_ERROR(e) \
boost::system::error_code(e, \
- boost::asio::detail::error_base<T>::misc_ecat)
+ boost::asio::detail::error_base<T>::misc_ecat())
# define BOOST_ASIO_WIN_OR_POSIX(e_win, e_posix) e_win
#else
# define BOOST_ASIO_NATIVE_ERROR(e) \
@@ -62,13 +62,13 @@
boost::system::native_ecat)
# define BOOST_ASIO_NETDB_ERROR(e) \
boost::system::error_code(e, \
- boost::asio::detail::error_base<T>::netdb_ecat)
+ boost::asio::detail::error_base<T>::netdb_ecat())
# define BOOST_ASIO_GETADDRINFO_ERROR(e) \
boost::system::error_code(e, \
- boost::asio::detail::error_base<T>::addrinfo_ecat)
+ boost::asio::detail::error_base<T>::addrinfo_ecat())
# define BOOST_ASIO_MISC_ERROR(e) \
boost::system::error_code(e, \
- boost::asio::detail::error_base<T>::misc_ecat)
+ boost::asio::detail::error_base<T>::misc_ecat())
# define BOOST_ASIO_WIN_OR_POSIX(e_win, e_posix) e_posix
#endif
@@ -83,25 +83,25 @@
{
public:
#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
- static boost::system::error_category netdb_ecat;
+ static boost::system::error_category netdb_ecat();
static int netdb_ed(const boost::system::error_code& ec);
static std::string netdb_md(const boost::system::error_code& ec);
static boost::system::wstring_t netdb_wmd(
const boost::system::error_code& ec);
- static boost::system::error_category addrinfo_ecat;
+ static boost::system::error_category addrinfo_ecat();
static int addrinfo_ed(const boost::system::error_code& ec);
static std::string addrinfo_md(const boost::system::error_code& ec);
static boost::system::wstring_t addrinfo_wmd(
const boost::system::error_code& ec);
#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
- static boost::system::error_category misc_ecat;
+ static boost::system::error_category misc_ecat();
static int misc_ed(const boost::system::error_code& ec);
static std::string misc_md(const boost::system::error_code& ec);
static boost::system::wstring_t misc_wmd(const boost::system::error_code& ec);
- static boost::system::error_category ssl_ecat;
+ static boost::system::error_category ssl_ecat();
static int ssl_ed(const boost::system::error_code& ec);
static std::string ssl_md(const boost::system::error_code& ec);
static boost::system::wstring_t ssl_wmd(const boost::system::error_code& ec);
@@ -233,9 +233,13 @@
#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
template <typename T>
-boost::system::error_category error_base<T>::netdb_ecat(
+boost::system::error_category error_base<T>::netdb_ecat()
+{
+ static boost::system::error_category ecat =
boost::system::error_code::new_category(&error_base<T>::netdb_ed,
- &error_base<T>::netdb_md, &error_base<T>::netdb_wmd));
+ &error_base<T>::netdb_md, &error_base<T>::netdb_wmd);
+ return ecat;
+}
template <typename T>
int error_base<T>::netdb_ed(const boost::system::error_code& ec)
@@ -273,9 +277,13 @@
}
template <typename T>
-boost::system::error_category error_base<T>::addrinfo_ecat(
+boost::system::error_category error_base<T>::addrinfo_ecat()
+{
+ static boost::system::error_category ecat =
boost::system::error_code::new_category(&error_base<T>::addrinfo_ed,
- &error_base<T>::addrinfo_md, &error_base<T>::addrinfo_wmd));
+ &error_base<T>::addrinfo_md, &error_base<T>::addrinfo_wmd);
+ return ecat;
+}
template <typename T>
int error_base<T>::addrinfo_ed(const boost::system::error_code& ec)
@@ -307,9 +315,13 @@
#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
template <typename T>
-boost::system::error_category error_base<T>::misc_ecat(
+boost::system::error_category error_base<T>::misc_ecat()
+{
+ static boost::system::error_category ecat =
boost::system::error_code::new_category(&error_base<T>::misc_ed,
- &error_base<T>::misc_md, &error_base<T>::misc_wmd));
+ &error_base<T>::misc_md, &error_base<T>::misc_wmd);
+ return ecat;
+}
template <typename T>
int error_base<T>::misc_ed(const boost::system::error_code& ec)
@@ -343,9 +355,13 @@
}
template <typename T>
-boost::system::error_category error_base<T>::ssl_ecat(
+boost::system::error_category error_base<T>::ssl_ecat()
+{
+ static boost::system::error_category ecat =
boost::system::error_code::new_category(&error_base<T>::ssl_ed,
- &error_base<T>::ssl_md, &error_base<T>::ssl_wmd));
+ &error_base<T>::ssl_md, &error_base<T>::ssl_wmd);
+ return ecat;
+}
template <typename T>
int error_base<T>::ssl_ed(const boost::system::error_code& ec)
Modified: trunk/boost/asio/ssl/detail/openssl_operation.hpp
==============================================================================
--- trunk/boost/asio/ssl/detail/openssl_operation.hpp (original)
+++ trunk/boost/asio/ssl/detail/openssl_operation.hpp 2007-08-20 10:11:46 EDT (Mon, 20 Aug 2007)
@@ -180,7 +180,7 @@
else
{
return handler_(boost::system::error_code(
- error_code, boost::asio::error::ssl_ecat), rc);
+ error_code, boost::asio::error::ssl_ecat()), rc);
}
}
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