Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62530 - in trunk/boost/asio: detail impl
From: chris_at_[hidden]
Date: 2010-06-07 19:24:28


Author: chris_kohlhoff
Date: 2010-06-07 19:24:28 EDT (Mon, 07 Jun 2010)
New Revision: 62530
URL: http://svn.boost.org/trac/boost/changeset/62530

Log:
Fixes for MSVC 7.1, Borland.

Text files modified:
   trunk/boost/asio/detail/service_registry.hpp | 2 +
   trunk/boost/asio/detail/win_fenced_block.hpp | 8 ++++
   trunk/boost/asio/detail/winsock_init.hpp | 2
   trunk/boost/asio/impl/io_service.hpp | 70 ++++++++++++++++++++++-----------------
   4 files changed, 51 insertions(+), 31 deletions(-)

Modified: trunk/boost/asio/detail/service_registry.hpp
==============================================================================
--- trunk/boost/asio/detail/service_registry.hpp (original)
+++ trunk/boost/asio/detail/service_registry.hpp 2010-06-07 19:24:28 EDT (Mon, 07 Jun 2010)
@@ -104,6 +104,8 @@
       boost::asio::io_service::service* service);
 
   // Helper class to manage service pointers.
+ struct auto_service_ptr;
+ friend struct auto_service_ptr;
   struct auto_service_ptr
   {
     boost::asio::io_service::service* ptr_;

Modified: trunk/boost/asio/detail/win_fenced_block.hpp
==============================================================================
--- trunk/boost/asio/detail/win_fenced_block.hpp (original)
+++ trunk/boost/asio/detail/win_fenced_block.hpp 2010-06-07 19:24:28 EDT (Mon, 07 Jun 2010)
@@ -62,6 +62,14 @@
     MemoryBarrier();
 #endif // defined(BOOST_MSVC) && (BOOST_MSVC < 1400)
   }
+
+#if defined(__BORLANDC__)
+ static void MemoryBarrier()
+ {
+ LONG barrier = 0;
+ ::InterlockedExchange(&barrier, 1);
+ }
+#endif // defined(__BORLANDC__)
 };
 
 } // namespace detail

Modified: trunk/boost/asio/detail/winsock_init.hpp
==============================================================================
--- trunk/boost/asio/detail/winsock_init.hpp (original)
+++ trunk/boost/asio/detail/winsock_init.hpp 2010-06-07 19:24:28 EDT (Mon, 07 Jun 2010)
@@ -71,7 +71,7 @@
 };
 
 template <int Major, int Minor>
-typename winsock_init<Major, Minor>::data winsock_init<Major, Minor>::data_;
+winsock_init_base::data winsock_init<Major, Minor>::data_;
 
 // Static variable to ensure that winsock is initialised before main, and
 // therefore before any other threads can get started.

Modified: trunk/boost/asio/impl/io_service.hpp
==============================================================================
--- trunk/boost/asio/impl/io_service.hpp (original)
+++ trunk/boost/asio/impl/io_service.hpp 2010-06-07 19:24:28 EDT (Mon, 07 Jun 2010)
@@ -17,6 +17,46 @@
 
 #include <boost/asio/detail/service_registry.hpp>
 
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+
+template <typename Service>
+inline Service& use_service(io_service& ios)
+{
+ // Check that Service meets the necessary type requirements.
+ (void)static_cast<io_service::service*>(static_cast<Service*>(0));
+ (void)static_cast<const io_service::id*>(&Service::id);
+
+ return ios.service_registry_->template use_service<Service>();
+}
+
+template <typename Service>
+inline void add_service(io_service& ios, Service* svc)
+{
+ // Check that Service meets the necessary type requirements.
+ (void)static_cast<io_service::service*>(static_cast<Service*>(0));
+ (void)static_cast<const io_service::id*>(&Service::id);
+
+ ios.service_registry_->template add_service<Service>(svc);
+}
+
+template <typename Service>
+inline bool has_service(io_service& ios)
+{
+ // Check that Service meets the necessary type requirements.
+ (void)static_cast<io_service::service*>(static_cast<Service*>(0));
+ (void)static_cast<const io_service::id*>(&Service::id);
+
+ return ios.service_registry_->template has_service<Service>();
+}
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
 #if defined(BOOST_ASIO_HAS_IOCP)
 # include <boost/asio/detail/win_iocp_io_service.hpp>
 #else
@@ -88,36 +128,6 @@
   return owner_;
 }
 
-template <typename Service>
-inline Service& use_service(io_service& ios)
-{
- // Check that Service meets the necessary type requirements.
- (void)static_cast<io_service::service*>(static_cast<Service*>(0));
- (void)static_cast<const io_service::id*>(&Service::id);
-
- return ios.service_registry_->template use_service<Service>();
-}
-
-template <typename Service>
-inline void add_service(io_service& ios, Service* svc)
-{
- // Check that Service meets the necessary type requirements.
- (void)static_cast<io_service::service*>(static_cast<Service*>(0));
- (void)static_cast<const io_service::id*>(&Service::id);
-
- ios.service_registry_->template add_service<Service>(svc);
-}
-
-template <typename Service>
-inline bool has_service(io_service& ios)
-{
- // Check that Service meets the necessary type requirements.
- (void)static_cast<io_service::service*>(static_cast<Service*>(0));
- (void)static_cast<const io_service::id*>(&Service::id);
-
- return ios.service_registry_->template has_service<Service>();
-}
-
 } // 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