Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84315 - in trunk: boost/asio boost/asio/detail boost/asio/detail/impl boost/asio/impl boost/asio/ip boost/asio/ip/detail boost/asio/ip/detail/impl boost/asio/ip/impl boost/asio/local boost/asio/ssl boost/asio/ssl/detail boost/asio/ssl/detail/impl boost/asio/ssl/impl boost/asio/ssl/old boost/asio/ssl/old/detail boost/asio/windows libs/asio/example/cpp03/icmp libs/asio/test libs/asio/test/ip libs/asio/test/latency libs/asio/test/local libs/asio/test/posix libs/asio/test/ssl libs/asio/test/windows
From: chris_at_[hidden]
Date: 2013-05-17 06:07:18


Author: chris_kohlhoff
Date: 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
New Revision: 84315
URL: http://svn.boost.org/trac/boost/changeset/84315

Log:
Partially decouple Asio from other boost components via an extra level
of indirection.

Added:
   trunk/boost/asio/detail/addressof.hpp (contents, props changed)
   trunk/boost/asio/detail/assert.hpp (contents, props changed)
   trunk/boost/asio/detail/cstdint.hpp (contents, props changed)
   trunk/boost/asio/detail/function.hpp (contents, props changed)
   trunk/boost/asio/detail/limits.hpp (contents, props changed)
   trunk/boost/asio/detail/throw_exception.hpp (contents, props changed)
   trunk/boost/asio/detail/type_traits.hpp (contents, props changed)
Text files modified:
   trunk/boost/asio/basic_deadline_timer.hpp | 7
   trunk/boost/asio/basic_socket.hpp | 4
   trunk/boost/asio/basic_socket_iostream.hpp | 81
   trunk/boost/asio/basic_socket_streambuf.hpp | 61
   trunk/boost/asio/basic_streambuf.hpp | 10
   trunk/boost/asio/basic_streambuf_fwd.hpp | 4
   trunk/boost/asio/buffer.hpp | 51
   trunk/boost/asio/buffered_read_stream.hpp | 6
   trunk/boost/asio/buffered_stream.hpp | 2
   trunk/boost/asio/buffered_write_stream.hpp | 6
   trunk/boost/asio/buffers_iterator.hpp | 33
   trunk/boost/asio/deadline_timer.hpp | 7
   trunk/boost/asio/deadline_timer_service.hpp | 7
   trunk/boost/asio/detail/atomic_count.hpp | 4
   trunk/boost/asio/detail/buffer_resize_guard.hpp | 8
   trunk/boost/asio/detail/buffer_sequence_adapter.hpp | 6
   trunk/boost/asio/detail/buffered_stream_storage.hpp | 6
   trunk/boost/asio/detail/chrono_time_traits.hpp | 18
   trunk/boost/asio/detail/completion_handler.hpp | 5
   trunk/boost/asio/detail/config.hpp | 694 +++-
   trunk/boost/asio/detail/consuming_buffers.hpp | 20
   trunk/boost/asio/detail/deadline_timer_service.hpp | 3
   trunk/boost/asio/detail/descriptor_ops.hpp | 4
   trunk/boost/asio/detail/descriptor_read_op.hpp | 10
   trunk/boost/asio/detail/descriptor_write_op.hpp | 10
   trunk/boost/asio/detail/dev_poll_reactor.hpp | 2
   trunk/boost/asio/detail/epoll_reactor.hpp | 5
   trunk/boost/asio/detail/event.hpp | 12
   trunk/boost/asio/detail/fd_set_adapter.hpp | 2
   trunk/boost/asio/detail/fenced_block.hpp | 10
   trunk/boost/asio/detail/handler_alloc_helpers.hpp | 13
   trunk/boost/asio/detail/handler_cont_helpers.hpp | 8
   trunk/boost/asio/detail/handler_invoke_helpers.hpp | 13
   trunk/boost/asio/detail/handler_tracking.hpp | 6
   trunk/boost/asio/detail/handler_type_requirements.hpp | 6
   trunk/boost/asio/detail/hash_map.hpp | 12
   trunk/boost/asio/detail/impl/descriptor_ops.ipp | 4
   trunk/boost/asio/detail/impl/dev_poll_reactor.ipp | 4
   trunk/boost/asio/detail/impl/eventfd_select_interrupter.ipp | 1
   trunk/boost/asio/detail/impl/handler_tracking.ipp | 180
   trunk/boost/asio/detail/impl/pipe_select_interrupter.ipp | 4
   trunk/boost/asio/detail/impl/posix_event.ipp | 4
   trunk/boost/asio/detail/impl/posix_mutex.ipp | 4
   trunk/boost/asio/detail/impl/posix_thread.ipp | 4
   trunk/boost/asio/detail/impl/posix_tss_ptr.ipp | 4
   trunk/boost/asio/detail/impl/reactive_descriptor_service.ipp | 4
   trunk/boost/asio/detail/impl/reactive_serial_port_service.ipp | 4
   trunk/boost/asio/detail/impl/select_reactor.ipp | 8
   trunk/boost/asio/detail/impl/service_registry.ipp | 6
   trunk/boost/asio/detail/impl/signal_set_service.ipp | 66
   trunk/boost/asio/detail/impl/socket_ops.ipp | 203
   trunk/boost/asio/detail/impl/socket_select_interrupter.ipp | 4
   trunk/boost/asio/detail/impl/strand_service.hpp | 5
   trunk/boost/asio/detail/impl/task_io_service.hpp | 5
   trunk/boost/asio/detail/impl/task_io_service.ipp | 26
   trunk/boost/asio/detail/impl/throw_error.ipp | 6
   trunk/boost/asio/detail/impl/timer_queue_ptime.ipp | 4
   trunk/boost/asio/detail/impl/win_event.ipp | 4
   trunk/boost/asio/detail/impl/win_iocp_handle_service.ipp | 8
   trunk/boost/asio/detail/impl/win_iocp_io_service.hpp | 5
   trunk/boost/asio/detail/impl/win_iocp_io_service.ipp | 2
   trunk/boost/asio/detail/impl/win_mutex.ipp | 4
   trunk/boost/asio/detail/impl/win_static_mutex.ipp | 10
   trunk/boost/asio/detail/impl/win_thread.ipp | 4
   trunk/boost/asio/detail/impl/win_tss_ptr.ipp | 4
   trunk/boost/asio/detail/impl/winsock_init.ipp | 4
   trunk/boost/asio/detail/io_control.hpp | 1
   trunk/boost/asio/detail/kqueue_reactor.hpp | 2
   trunk/boost/asio/detail/local_free_on_block_exit.hpp | 4
   trunk/boost/asio/detail/mutex.hpp | 12
   trunk/boost/asio/detail/noncopyable.hpp | 10
   trunk/boost/asio/detail/null_event.hpp | 4
   trunk/boost/asio/detail/null_mutex.hpp | 4
   trunk/boost/asio/detail/null_signal_blocker.hpp | 10
   trunk/boost/asio/detail/null_static_mutex.hpp | 4
   trunk/boost/asio/detail/null_thread.hpp | 4
   trunk/boost/asio/detail/null_tss_ptr.hpp | 4
   trunk/boost/asio/detail/old_win_sdk_compat.hpp | 4
   trunk/boost/asio/detail/pipe_select_interrupter.hpp | 4
   trunk/boost/asio/detail/posix_event.hpp | 14
   trunk/boost/asio/detail/posix_fd_set_adapter.hpp | 4
   trunk/boost/asio/detail/posix_mutex.hpp | 4
   trunk/boost/asio/detail/posix_signal_blocker.hpp | 4
   trunk/boost/asio/detail/posix_static_mutex.hpp | 4
   trunk/boost/asio/detail/posix_thread.hpp | 4
   trunk/boost/asio/detail/posix_tss_ptr.hpp | 4
   trunk/boost/asio/detail/reactive_descriptor_service.hpp | 14
   trunk/boost/asio/detail/reactive_null_buffers_op.hpp | 6
   trunk/boost/asio/detail/reactive_serial_port_service.hpp | 4
   trunk/boost/asio/detail/reactive_socket_accept_op.hpp | 6
   trunk/boost/asio/detail/reactive_socket_connect_op.hpp | 6
   trunk/boost/asio/detail/reactive_socket_recv_op.hpp | 6
   trunk/boost/asio/detail/reactive_socket_recvfrom_op.hpp | 6
   trunk/boost/asio/detail/reactive_socket_recvmsg_op.hpp | 6
   trunk/boost/asio/detail/reactive_socket_send_op.hpp | 6
   trunk/boost/asio/detail/reactive_socket_sendto_op.hpp | 6
   trunk/boost/asio/detail/reactive_socket_service.hpp | 14
   trunk/boost/asio/detail/reactive_socket_service_base.hpp | 14
   trunk/boost/asio/detail/regex_fwd.hpp | 4
   trunk/boost/asio/detail/resolve_endpoint_op.hpp | 6
   trunk/boost/asio/detail/resolve_op.hpp | 6
   trunk/boost/asio/detail/resolver_service.hpp | 5
   trunk/boost/asio/detail/select_interrupter.hpp | 4
   trunk/boost/asio/detail/select_reactor.hpp | 8
   trunk/boost/asio/detail/service_registry.hpp | 6
   trunk/boost/asio/detail/signal_blocker.hpp | 12
   trunk/boost/asio/detail/signal_handler.hpp | 5
   trunk/boost/asio/detail/signal_init.hpp | 4
   trunk/boost/asio/detail/signal_set_service.hpp | 11
   trunk/boost/asio/detail/socket_ops.hpp | 6
   trunk/boost/asio/detail/socket_option.hpp | 15
   trunk/boost/asio/detail/socket_select_interrupter.hpp | 4
   trunk/boost/asio/detail/socket_types.hpp | 4
   trunk/boost/asio/detail/static_mutex.hpp | 12
   trunk/boost/asio/detail/thread.hpp | 12
   trunk/boost/asio/detail/timer_queue.hpp | 9
   trunk/boost/asio/detail/timer_queue_ptime.hpp | 4
   trunk/boost/asio/detail/tss_ptr.hpp | 18
   trunk/boost/asio/detail/wait_handler.hpp | 5
   trunk/boost/asio/detail/win_event.hpp | 14
   trunk/boost/asio/detail/win_fd_set_adapter.hpp | 4
   trunk/boost/asio/detail/win_fenced_block.hpp | 10
   trunk/boost/asio/detail/win_iocp_handle_read_op.hpp | 6
   trunk/boost/asio/detail/win_iocp_handle_service.hpp | 35
   trunk/boost/asio/detail/win_iocp_handle_write_op.hpp | 6
   trunk/boost/asio/detail/win_iocp_io_service.hpp | 2
   trunk/boost/asio/detail/win_iocp_null_buffers_op.hpp | 6
   trunk/boost/asio/detail/win_iocp_overlapped_op.hpp | 6
   trunk/boost/asio/detail/win_iocp_overlapped_ptr.hpp | 4
   trunk/boost/asio/detail/win_iocp_socket_accept_op.hpp | 6
   trunk/boost/asio/detail/win_iocp_socket_recv_op.hpp | 6
   trunk/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp | 6
   trunk/boost/asio/detail/win_iocp_socket_recvmsg_op.hpp | 6
   trunk/boost/asio/detail/win_iocp_socket_send_op.hpp | 6
   trunk/boost/asio/detail/win_iocp_socket_service.hpp | 14
   trunk/boost/asio/detail/win_iocp_socket_service_base.hpp | 15
   trunk/boost/asio/detail/win_mutex.hpp | 4
   trunk/boost/asio/detail/win_object_handle_service.hpp | 4
   trunk/boost/asio/detail/win_static_mutex.hpp | 4
   trunk/boost/asio/detail/win_thread.hpp | 4
   trunk/boost/asio/detail/win_tss_ptr.hpp | 4
   trunk/boost/asio/detail/wince_thread.hpp | 4
   trunk/boost/asio/detail/winsock_init.hpp | 4
   trunk/boost/asio/error.hpp | 10
   trunk/boost/asio/impl/error.ipp | 4
   trunk/boost/asio/impl/io_service.ipp | 2
   trunk/boost/asio/impl/read.hpp | 8
   trunk/boost/asio/impl/read_at.hpp | 54
   trunk/boost/asio/impl/read_until.hpp | 16
   trunk/boost/asio/impl/serial_port_base.ipp | 32
   trunk/boost/asio/impl/write.hpp | 8
   trunk/boost/asio/impl/write_at.hpp | 54
   trunk/boost/asio/io_service.hpp | 4
   trunk/boost/asio/ip/address.hpp | 8
   trunk/boost/asio/ip/address_v4.hpp | 8
   trunk/boost/asio/ip/address_v6.hpp | 8
   trunk/boost/asio/ip/basic_endpoint.hpp | 8
   trunk/boost/asio/ip/detail/endpoint.hpp | 4
   trunk/boost/asio/ip/detail/impl/endpoint.ipp | 8
   trunk/boost/asio/ip/detail/socket_option.hpp | 18
   trunk/boost/asio/ip/impl/address.hpp | 4
   trunk/boost/asio/ip/impl/address.ipp | 6
   trunk/boost/asio/ip/impl/address_v4.hpp | 4
   trunk/boost/asio/ip/impl/address_v4.ipp | 6
   trunk/boost/asio/ip/impl/address_v6.hpp | 4
   trunk/boost/asio/ip/impl/address_v6.ipp | 6
   trunk/boost/asio/ip/impl/basic_endpoint.hpp | 4
   trunk/boost/asio/ip/resolver_query_base.hpp | 7
   trunk/boost/asio/ip/tcp.hpp | 4
   trunk/boost/asio/is_read_buffered.hpp | 2
   trunk/boost/asio/is_write_buffered.hpp | 2
   trunk/boost/asio/local/basic_endpoint.hpp | 4
   trunk/boost/asio/local/stream_protocol.hpp | 4
   trunk/boost/asio/placeholders.hpp | 19
   trunk/boost/asio/read.hpp | 8
   trunk/boost/asio/read_at.hpp | 34
   trunk/boost/asio/read_until.hpp | 30
   trunk/boost/asio/serial_port_base.hpp | 13
   trunk/boost/asio/socket_base.hpp | 17
   trunk/boost/asio/ssl/context_base.hpp | 25
   trunk/boost/asio/ssl/detail/impl/openssl_init.ipp | 14
   trunk/boost/asio/ssl/detail/io.hpp | 14
   trunk/boost/asio/ssl/detail/stream_core.hpp | 42
   trunk/boost/asio/ssl/impl/context.ipp | 6
   trunk/boost/asio/ssl/old/detail/openssl_operation.hpp | 6
   trunk/boost/asio/ssl/old/stream.hpp | 4
   trunk/boost/asio/ssl/stream.hpp | 4
   trunk/boost/asio/ssl/stream_base.hpp | 7
   trunk/boost/asio/streambuf.hpp | 4
   trunk/boost/asio/time_traits.hpp | 6
   trunk/boost/asio/windows/basic_random_access_handle.hpp | 12
   trunk/boost/asio/windows/random_access_handle_service.hpp | 10
   trunk/boost/asio/write.hpp | 8
   trunk/boost/asio/write_at.hpp | 34
   trunk/libs/asio/example/cpp03/icmp/ping.cpp | 4
   trunk/libs/asio/test/basic_datagram_socket.cpp | 11
   trunk/libs/asio/test/basic_deadline_timer.cpp | 11
   trunk/libs/asio/test/basic_raw_socket.cpp | 11
   trunk/libs/asio/test/basic_seq_packet_socket.cpp | 11
   trunk/libs/asio/test/basic_serial_port.cpp | 11
   trunk/libs/asio/test/basic_signal_set.cpp | 11
   trunk/libs/asio/test/basic_socket_acceptor.cpp | 11
   trunk/libs/asio/test/basic_stream_socket.cpp | 11
   trunk/libs/asio/test/basic_streambuf.cpp | 11
   trunk/libs/asio/test/basic_waitable_timer.cpp | 11
   trunk/libs/asio/test/buffer.cpp | 24
   trunk/libs/asio/test/buffered_read_stream.cpp | 79
   trunk/libs/asio/test/buffered_stream.cpp | 85
   trunk/libs/asio/test/buffered_write_stream.cpp | 85
   trunk/libs/asio/test/buffers_iterator.cpp | 24
   trunk/libs/asio/test/completion_condition.cpp | 11
   trunk/libs/asio/test/connect.cpp | 11
   trunk/libs/asio/test/datagram_socket_service.cpp | 11
   trunk/libs/asio/test/deadline_timer.cpp | 81
   trunk/libs/asio/test/deadline_timer_service.cpp | 11
   trunk/libs/asio/test/error.cpp | 27
   trunk/libs/asio/test/high_resolution_timer.cpp | 11
   trunk/libs/asio/test/io_service.cpp | 196
   trunk/libs/asio/test/ip/address.cpp | 12
   trunk/libs/asio/test/ip/address_v4.cpp | 205
   trunk/libs/asio/test/ip/address_v6.cpp | 342 +-
   trunk/libs/asio/test/ip/basic_endpoint.cpp | 11
   trunk/libs/asio/test/ip/basic_resolver.cpp | 11
   trunk/libs/asio/test/ip/basic_resolver_entry.cpp | 11
   trunk/libs/asio/test/ip/basic_resolver_iterator.cpp | 11
   trunk/libs/asio/test/ip/basic_resolver_query.cpp | 11
   trunk/libs/asio/test/ip/host_name.cpp | 11
   trunk/libs/asio/test/ip/icmp.cpp | 14
   trunk/libs/asio/test/ip/multicast.cpp | 165
   trunk/libs/asio/test/ip/resolver_query_base.cpp | 11
   trunk/libs/asio/test/ip/resolver_service.cpp | 11
   trunk/libs/asio/test/ip/tcp.cpp | 178
   trunk/libs/asio/test/ip/udp.cpp | 53
   trunk/libs/asio/test/ip/unicast.cpp | 79
   trunk/libs/asio/test/ip/v6_only.cpp | 47
   trunk/libs/asio/test/is_read_buffered.cpp | 30
   trunk/libs/asio/test/is_write_buffered.cpp | 30
   trunk/libs/asio/test/latency/high_res_clock.hpp | 2
   trunk/libs/asio/test/local/basic_endpoint.cpp | 11
   trunk/libs/asio/test/local/connect_pair.cpp | 11
   trunk/libs/asio/test/local/datagram_protocol.cpp | 12
   trunk/libs/asio/test/local/stream_protocol.cpp | 12
   trunk/libs/asio/test/placeholders.cpp | 11
   trunk/libs/asio/test/posix/basic_descriptor.cpp | 11
   trunk/libs/asio/test/posix/basic_stream_descriptor.cpp | 11
   trunk/libs/asio/test/posix/descriptor_base.cpp | 11
   trunk/libs/asio/test/posix/stream_descriptor.cpp | 12
   trunk/libs/asio/test/posix/stream_descriptor_service.cpp | 11
   trunk/libs/asio/test/raw_socket_service.cpp | 11
   trunk/libs/asio/test/read.cpp | 2799 +++++++++----------
   trunk/libs/asio/test/read_at.cpp | 5374 +++++++++++++++++--------------------
   trunk/libs/asio/test/read_until.cpp | 463 +-
   trunk/libs/asio/test/seq_packet_socket_service.cpp | 11
   trunk/libs/asio/test/serial_port.cpp | 11
   trunk/libs/asio/test/serial_port_base.cpp | 11
   trunk/libs/asio/test/serial_port_service.cpp | 11
   trunk/libs/asio/test/signal_set.cpp | 11
   trunk/libs/asio/test/signal_set_service.cpp | 11
   trunk/libs/asio/test/socket_acceptor_service.cpp | 11
   trunk/libs/asio/test/socket_base.cpp | 431 +-
   trunk/libs/asio/test/ssl/basic_context.cpp | 11
   trunk/libs/asio/test/ssl/context.cpp | 11
   trunk/libs/asio/test/ssl/context_base.cpp | 11
   trunk/libs/asio/test/ssl/context_service.cpp | 11
   trunk/libs/asio/test/ssl/rfc2818_verification.cpp | 11
   trunk/libs/asio/test/ssl/stream.cpp | 11
   trunk/libs/asio/test/ssl/stream_base.cpp | 11
   trunk/libs/asio/test/ssl/stream_service.cpp | 11
   trunk/libs/asio/test/steady_timer.cpp | 11
   trunk/libs/asio/test/strand.cpp | 120
   trunk/libs/asio/test/stream_socket_service.cpp | 11
   trunk/libs/asio/test/streambuf.cpp | 25
   trunk/libs/asio/test/system_timer.cpp | 336 ++
   trunk/libs/asio/test/time_traits.cpp | 11
   trunk/libs/asio/test/unit_test.hpp | 65
   trunk/libs/asio/test/wait_traits.cpp | 11
   trunk/libs/asio/test/waitable_timer_service.cpp | 11
   trunk/libs/asio/test/windows/basic_handle.cpp | 11
   trunk/libs/asio/test/windows/basic_object_handle.cpp | 11
   trunk/libs/asio/test/windows/basic_random_access_handle.cpp | 11
   trunk/libs/asio/test/windows/basic_stream_handle.cpp | 11
   trunk/libs/asio/test/windows/object_handle.cpp | 12
   trunk/libs/asio/test/windows/object_handle_service.cpp | 11
   trunk/libs/asio/test/windows/overlapped_ptr.cpp | 12
   trunk/libs/asio/test/windows/random_access_handle.cpp | 12
   trunk/libs/asio/test/windows/random_access_handle_service.cpp | 11
   trunk/libs/asio/test/windows/stream_handle.cpp | 12
   trunk/libs/asio/test/windows/stream_handle_service.cpp | 11
   trunk/libs/asio/test/write.cpp | 2943 +++++++++-----------
   trunk/libs/asio/test/write_at.cpp | 5700 +++++++++++++++++----------------------
   290 files changed, 11496 insertions(+), 12162 deletions(-)

Modified: trunk/boost/asio/basic_deadline_timer.hpp
==============================================================================
--- trunk/boost/asio/basic_deadline_timer.hpp (original)
+++ trunk/boost/asio/basic_deadline_timer.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,6 +16,10 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \
+ || defined(GENERATING_DOCUMENTATION)
+
 #include <cstddef>
 #include <boost/asio/basic_io_object.hpp>
 #include <boost/asio/deadline_timer_service.hpp>
@@ -510,4 +514,7 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ // || defined(GENERATING_DOCUMENTATION)
+
 #endif // BOOST_ASIO_BASIC_DEADLINE_TIMER_HPP

Modified: trunk/boost/asio/basic_socket.hpp
==============================================================================
--- trunk/boost/asio/basic_socket.hpp (original)
+++ trunk/boost/asio/basic_socket.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -396,7 +396,7 @@
    * CancelIoEx function is always used. This function does not have the
    * problems described above.
    */
-#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) \
+#if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC >= 1400) \
   && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \
   && !defined(BOOST_ASIO_ENABLE_CANCELIO)
   __declspec(deprecated("By default, this function always fails with "
@@ -444,7 +444,7 @@
    * CancelIoEx function is always used. This function does not have the
    * problems described above.
    */
-#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) \
+#if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC >= 1400) \
   && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \
   && !defined(BOOST_ASIO_ENABLE_CANCELIO)
   __declspec(deprecated("By default, this function always fails with "

Modified: trunk/boost/asio/basic_socket_iostream.hpp
==============================================================================
--- trunk/boost/asio/basic_socket_iostream.hpp (original)
+++ trunk/boost/asio/basic_socket_iostream.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,9 +17,10 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
-#include <boost/utility/base_from_member.hpp>
+#include <istream>
+#include <ostream>
 #include <boost/asio/basic_socket_streambuf.hpp>
 #include <boost/asio/stream_socket_service.hpp>
 
@@ -37,9 +38,10 @@
 // A macro that should expand to:
 // template <typename T1, ..., typename Tn>
 // explicit basic_socket_iostream(T1 x1, ..., Tn xn)
-// : basic_iostream<char>(&this->boost::base_from_member<
-// basic_socket_streambuf<Protocol, StreamSocketService,
-// Time, TimeTraits, TimerService> >::member)
+// : std::basic_iostream<char>(
+// &this->detail::socket_iostream_base<
+// Protocol, StreamSocketService, Time,
+// TimeTraits, TimerService>::streambuf_)
 // {
 // if (rdbuf()->connect(x1, ..., xn) == 0)
 // this->setstate(std::ios_base::failbit);
@@ -49,9 +51,10 @@
 # define BOOST_ASIO_PRIVATE_CTR_DEF(z, n, data) \
   template <BOOST_PP_ENUM_PARAMS(n, typename T)> \
   explicit basic_socket_iostream(BOOST_PP_ENUM_BINARY_PARAMS(n, T, x)) \
- : std::basic_iostream<char>(&this->boost::base_from_member< \
- basic_socket_streambuf<Protocol, StreamSocketService, \
- Time, TimeTraits, TimerService> >::member) \
+ : std::basic_iostream<char>( \
+ &this->detail::socket_iostream_base< \
+ Protocol, StreamSocketService, Time, \
+ TimeTraits, TimerService>::streambuf_) \
   { \
     this->setf(std::ios_base::unitbuf); \
     if (rdbuf()->connect(BOOST_PP_ENUM_PARAMS(n, x)) == 0) \
@@ -83,34 +86,69 @@
 
 namespace boost {
 namespace asio {
+namespace detail {
+
+// A separate base class is used to ensure that the streambuf is initialised
+// prior to the basic_socket_iostream's basic_iostream base class.
+template <typename Protocol, typename StreamSocketService,
+ typename Time, typename TimeTraits, typename TimerService>
+class socket_iostream_base
+{
+protected:
+ basic_socket_streambuf<Protocol, StreamSocketService,
+ Time, TimeTraits, TimerService> streambuf_;
+};
+
+}
 
 /// Iostream interface for a socket.
 template <typename Protocol,
     typename StreamSocketService = stream_socket_service<Protocol>,
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \
+ || defined(GENERATING_DOCUMENTATION)
     typename Time = boost::posix_time::ptime,
     typename TimeTraits = boost::asio::time_traits<Time>,
     typename TimerService = deadline_timer_service<Time, TimeTraits> >
+#else
+ typename Time = steady_timer::clock_type,
+ typename TimeTraits = steady_timer::traits_type,
+ typename TimerService = steady_timer::service_type>
+#endif
 class basic_socket_iostream
- : public boost::base_from_member<
- basic_socket_streambuf<Protocol, StreamSocketService,
- Time, TimeTraits, TimerService> >,
+ : private detail::socket_iostream_base<Protocol,
+ StreamSocketService, Time, TimeTraits, TimerService>,
     public std::basic_iostream<char>
 {
+private:
+ // These typedefs are intended keep this class's implementation independent
+ // of whether it's using Boost.DateTime, Boost.Chrono or std::chrono.
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ typedef TimeTraits traits_helper;
+#else
+ typedef detail::chrono_time_traits<Time, TimeTraits> traits_helper;
+#endif
+
 public:
   /// The endpoint type.
   typedef typename Protocol::endpoint endpoint_type;
 
+#if defined(GENERATING_DOCUMENTATION)
   /// The time type.
   typedef typename TimeTraits::time_type time_type;
 
   /// The duration type.
   typedef typename TimeTraits::duration_type duration_type;
+#else
+ typedef typename traits_helper::time_type time_type;
+ typedef typename traits_helper::duration_type duration_type;
+#endif
 
   /// Construct a basic_socket_iostream without establishing a connection.
   basic_socket_iostream()
- : std::basic_iostream<char>(&this->boost::base_from_member<
- basic_socket_streambuf<Protocol, StreamSocketService,
- Time, TimeTraits, TimerService> >::member)
+ : std::basic_iostream<char>(
+ &this->detail::socket_iostream_base<
+ Protocol, StreamSocketService, Time,
+ TimeTraits, TimerService>::streambuf_)
   {
     this->setf(std::ios_base::unitbuf);
   }
@@ -127,9 +165,10 @@
 #elif defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
   template <typename... T>
   explicit basic_socket_iostream(T... x)
- : std::basic_iostream<char>(&this->boost::base_from_member<
- basic_socket_streambuf<Protocol, StreamSocketService,
- Time, TimeTraits, TimerService> >::member)
+ : std::basic_iostream<char>(
+ &this->detail::socket_iostream_base<
+ Protocol, StreamSocketService, Time,
+ TimeTraits, TimerService>::streambuf_)
   {
     this->setf(std::ios_base::unitbuf);
     if (rdbuf()->connect(x...) == 0)
@@ -176,9 +215,9 @@
   {
     return const_cast<basic_socket_streambuf<Protocol, StreamSocketService,
       Time, TimeTraits, TimerService>*>(
- &this->boost::base_from_member<
- basic_socket_streambuf<Protocol, StreamSocketService,
- Time, TimeTraits, TimerService> >::member);
+ &this->detail::socket_iostream_base<
+ Protocol, StreamSocketService, Time,
+ TimeTraits, TimerService>::streambuf_);
   }
 
   /// Get the last error associated with the stream.
@@ -255,6 +294,6 @@
 # undef BOOST_ASIO_PRIVATE_CONNECT_DEF
 #endif // !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
 
-#endif // defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_BASIC_SOCKET_IOSTREAM_HPP

Modified: trunk/boost/asio/basic_socket_streambuf.hpp
==============================================================================
--- trunk/boost/asio/basic_socket_streambuf.hpp (original)
+++ trunk/boost/asio/basic_socket_streambuf.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,21 +17,21 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <streambuf>
-#include <boost/utility/base_from_member.hpp>
 #include <boost/asio/basic_socket.hpp>
 #include <boost/asio/deadline_timer_service.hpp>
 #include <boost/asio/detail/array.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/stream_socket_service.hpp>
-#include <boost/asio/time_traits.hpp>
 
-#include <boost/asio/detail/push_options.hpp>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
-#include <boost/asio/detail/pop_options.hpp>
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/deadline_timer.hpp>
+#else
+# include <boost/asio/steady_timer.hpp>
+#endif
 
 #if !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
 
@@ -82,32 +82,64 @@
 
 namespace boost {
 namespace asio {
+namespace detail {
+
+// A separate base class is used to ensure that the io_service is initialised
+// prior to the basic_socket_streambuf's basic_socket base class.
+class socket_streambuf_base
+{
+protected:
+ io_service io_service_;
+};
+
+} // namespace detail
 
 /// Iostream streambuf for a socket.
 template <typename Protocol,
     typename StreamSocketService = stream_socket_service<Protocol>,
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \
+ || defined(GENERATING_DOCUMENTATION)
     typename Time = boost::posix_time::ptime,
     typename TimeTraits = boost::asio::time_traits<Time>,
     typename TimerService = deadline_timer_service<Time, TimeTraits> >
+#else
+ typename Time = steady_timer::clock_type,
+ typename TimeTraits = steady_timer::traits_type,
+ typename TimerService = steady_timer::service_type>
+#endif
 class basic_socket_streambuf
   : public std::streambuf,
- private boost::base_from_member<io_service>,
+ private detail::socket_streambuf_base,
     public basic_socket<Protocol, StreamSocketService>
 {
+private:
+ // These typedefs are intended keep this class's implementation independent
+ // of whether it's using Boost.DateTime, Boost.Chrono or std::chrono.
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ typedef TimeTraits traits_helper;
+#else
+ typedef detail::chrono_time_traits<Time, TimeTraits> traits_helper;
+#endif
+
 public:
   /// The endpoint type.
   typedef typename Protocol::endpoint endpoint_type;
 
+#if defined(GENERATING_DOCUMENTATION)
   /// The time type.
   typedef typename TimeTraits::time_type time_type;
 
   /// The duration type.
   typedef typename TimeTraits::duration_type duration_type;
+#else
+ typedef typename traits_helper::time_type time_type;
+ typedef typename traits_helper::duration_type duration_type;
+#endif
 
   /// Construct a basic_socket_streambuf without establishing a connection.
   basic_socket_streambuf()
     : basic_socket<Protocol, StreamSocketService>(
- boost::base_from_member<boost::asio::io_service>::member),
+ this->detail::socket_streambuf_base::io_service_),
       unbuffered_(false),
       timer_service_(0),
       timer_state_(no_timer)
@@ -252,7 +284,7 @@
    */
   duration_type expires_from_now() const
   {
- return TimeTraits::subtract(expires_at(), TimeTraits::now());
+ return traits_helper::subtract(expires_at(), traits_helper::now());
   }
 
   /// Set the stream buffer's expiry time relative to now.
@@ -424,8 +456,7 @@
   {
     typedef typename Protocol::resolver resolver_type;
     typedef typename resolver_type::iterator iterator_type;
- resolver_type resolver(
- boost::base_from_member<boost::asio::io_service>::member);
+ resolver_type resolver(detail::socket_streambuf_base::io_service_);
     iterator_type i = resolver.resolve(query, ec_);
     if (!ec_)
     {
@@ -477,12 +508,12 @@
 
     void operator()(const boost::system::error_code&)
     {
- time_type now = TimeTraits::now();
+ time_type now = traits_helper::now();
 
       time_type expiry_time = this_->timer_service_->expires_at(
             this_->timer_implementation_);
 
- if (TimeTraits::less_than(now, expiry_time))
+ if (traits_helper::less_than(now, expiry_time))
       {
         this_->timer_state_ = timer_is_pending;
         this_->timer_service_->async_wait(this_->timer_implementation_, *this);
@@ -501,7 +532,7 @@
     if (timer_service_ == 0)
     {
       TimerService& timer_service = use_service<TimerService>(
- boost::base_from_member<boost::asio::io_service>::member);
+ detail::socket_streambuf_base::io_service_);
       timer_service.construct(timer_implementation_);
       timer_service_ = &timer_service;
     }
@@ -543,6 +574,6 @@
 # undef BOOST_ASIO_PRIVATE_CONNECT_DEF
 #endif // !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_BASIC_SOCKET_STREAMBUF_HPP

Modified: trunk/boost/asio/basic_streambuf.hpp
==============================================================================
--- trunk/boost/asio/basic_streambuf.hpp (original)
+++ trunk/boost/asio/basic_streambuf.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,18 +17,18 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <algorithm>
 #include <cstring>
 #include <stdexcept>
 #include <streambuf>
 #include <vector>
-#include <boost/limits.hpp>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/basic_streambuf_fwd.hpp>
 #include <boost/asio/buffer.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -327,7 +327,7 @@
       else
       {
         std::length_error ex("boost::asio::streambuf too long");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
       }
     }
 
@@ -365,6 +365,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_BASIC_STREAMBUF_HPP

Modified: trunk/boost/asio/basic_streambuf_fwd.hpp
==============================================================================
--- trunk/boost/asio/basic_streambuf_fwd.hpp (original)
+++ trunk/boost/asio/basic_streambuf_fwd.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <memory>
 
@@ -30,6 +30,6 @@
 } // namespace asio
 } // namespace boost
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_BASIC_STREAMBUF_FWD_HPP

Modified: trunk/boost/asio/buffer.hpp
==============================================================================
--- trunk/boost/asio/buffer.hpp (original)
+++ trunk/boost/asio/buffer.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -20,16 +20,15 @@
 #include <cstring>
 #include <string>
 #include <vector>
-#include <boost/detail/workaround.hpp>
 #include <boost/asio/detail/array_fwd.hpp>
 
-#if defined(BOOST_MSVC)
+#if defined(BOOST_ASIO_MSVC)
 # if defined(_HAS_ITERATOR_DEBUGGING) && (_HAS_ITERATOR_DEBUGGING != 0)
 # if !defined(BOOST_ASIO_DISABLE_BUFFER_DEBUGGING)
 # define BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
 # endif // !defined(BOOST_ASIO_DISABLE_BUFFER_DEBUGGING)
 # endif // defined(_HAS_ITERATOR_DEBUGGING)
-#endif // defined(BOOST_MSVC)
+#endif // defined(BOOST_ASIO_MSVC)
 
 #if defined(__GNUC__)
 # if defined(_GLIBCXX_DEBUG)
@@ -40,14 +39,21 @@
 #endif // defined(__GNUC__)
 
 #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
-# include <boost/function.hpp>
+# include <boost/asio/detail/function.hpp>
 #endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
 
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) \
- || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
-# include <boost/type_traits/is_const.hpp>
-#endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
- // || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+#if defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
+# include <boost/detail/workaround.hpp>
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) \
+ || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+# define BOOST_ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND
+# endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+ // || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+#endif // defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
+
+#if defined(BOOST_ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
+# include <boost/asio/detail/type_traits.hpp>
+#endif // defined(BOOST_ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -102,14 +108,14 @@
 
 #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
   mutable_buffer(void* data, std::size_t size,
- boost::function<void()> debug_check)
+ boost::asio::detail::function<void()> debug_check)
     : data_(data),
       size_(size),
       debug_check_(debug_check)
   {
   }
 
- const boost::function<void()>& get_debug_check() const
+ const boost::asio::detail::function<void()>& get_debug_check() const
   {
     return debug_check_;
   }
@@ -125,7 +131,7 @@
   std::size_t size_;
 
 #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
- boost::function<void()> debug_check_;
+ boost::asio::detail::function<void()> debug_check_;
 #endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
 };
 
@@ -232,14 +238,14 @@
 
 #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
   const_buffer(const void* data, std::size_t size,
- boost::function<void()> debug_check)
+ boost::asio::detail::function<void()> debug_check)
     : data_(data),
       size_(size),
       debug_check_(debug_check)
   {
   }
 
- const boost::function<void()>& get_debug_check() const
+ const boost::asio::detail::function<void()>& get_debug_check() const
   {
     return debug_check_;
   }
@@ -255,7 +261,7 @@
   std::size_t size_;
 
 #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
- boost::function<void()> debug_check_;
+ boost::asio::detail::function<void()> debug_check_;
 #endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
 };
 
@@ -512,12 +518,12 @@
 
   ~buffer_debug_check()
   {
-#if BOOST_WORKAROUND(BOOST_MSVC, == 1400)
+#if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC == 1400)
     // MSVC 8's string iterator checking may crash in a std::string::iterator
     // object's destructor when the iterator points to an already-destroyed
     // std::string object, unless the iterator is cleared first.
     iter_ = Iterator();
-#endif // BOOST_WORKAROUND(BOOST_MSVC, == 1400)
+#endif // defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC == 1400)
   }
 
   void operator()()
@@ -828,8 +834,7 @@
         ? N * sizeof(PodType) : max_size_in_bytes));
 }
 
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) \
- || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+#if defined(BOOST_ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
 
 // Borland C++ and Sun Studio think the overloads:
 //
@@ -864,7 +869,7 @@
 
 template <typename PodType>
 struct buffer_types
- : public buffer_types_base<boost::is_const<PodType>::value>
+ : public buffer_types_base<is_const<PodType>::value>
 {
 };
 
@@ -896,8 +901,7 @@
         ? data.size() * sizeof(PodType) : max_size_in_bytes));
 }
 
-#else // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
- // || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+#else // defined(BOOST_ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
 
 /// Create a new modifiable buffer that represents the given POD array.
 /**
@@ -961,8 +965,7 @@
         ? data.size() * sizeof(PodType) : max_size_in_bytes));
 }
 
-#endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
- // || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+#endif // defined(BOOST_ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
 
 /// Create a new non-modifiable buffer that represents the given POD array.
 /**

Modified: trunk/boost/asio/buffered_read_stream.hpp
==============================================================================
--- trunk/boost/asio/buffered_read_stream.hpp (original)
+++ trunk/boost/asio/buffered_read_stream.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,13 +17,13 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
-#include <boost/type_traits/remove_reference.hpp>
 #include <boost/asio/buffered_read_stream_fwd.hpp>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_resize_guard.hpp>
 #include <boost/asio/detail/buffered_stream_storage.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 
@@ -50,7 +50,7 @@
 {
 public:
   /// The type of the next layer.
- typedef typename boost::remove_reference<Stream>::type next_layer_type;
+ typedef typename remove_reference<Stream>::type next_layer_type;
 
   /// The type of the lowest layer.
   typedef typename next_layer_type::lowest_layer_type lowest_layer_type;
@@ -59,7 +59,7 @@
   /// The default buffer size.
   static const std::size_t default_buffer_size = implementation_defined;
 #else
- BOOST_STATIC_CONSTANT(std::size_t, default_buffer_size = 1024);
+ BOOST_ASIO_STATIC_CONSTANT(std::size_t, default_buffer_size = 1024);
 #endif
 
   /// Construct, passing the specified argument to initialise the next layer.

Modified: trunk/boost/asio/buffered_stream.hpp
==============================================================================
--- trunk/boost/asio/buffered_stream.hpp (original)
+++ trunk/boost/asio/buffered_stream.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -47,7 +47,7 @@
 {
 public:
   /// The type of the next layer.
- typedef typename boost::remove_reference<Stream>::type next_layer_type;
+ typedef typename remove_reference<Stream>::type next_layer_type;
 
   /// The type of the lowest layer.
   typedef typename next_layer_type::lowest_layer_type lowest_layer_type;

Modified: trunk/boost/asio/buffered_write_stream.hpp
==============================================================================
--- trunk/boost/asio/buffered_write_stream.hpp (original)
+++ trunk/boost/asio/buffered_write_stream.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,13 +17,13 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
-#include <boost/type_traits/remove_reference.hpp>
 #include <boost/asio/buffered_write_stream_fwd.hpp>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/completion_condition.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffered_stream_storage.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/write.hpp>
@@ -51,7 +51,7 @@
 {
 public:
   /// The type of the next layer.
- typedef typename boost::remove_reference<Stream>::type next_layer_type;
+ typedef typename remove_reference<Stream>::type next_layer_type;
 
   /// The type of the lowest layer.
   typedef typename next_layer_type::lowest_layer_type lowest_layer_type;
@@ -60,7 +60,7 @@
   /// The default buffer size.
   static const std::size_t default_buffer_size = implementation_defined;
 #else
- BOOST_STATIC_CONSTANT(std::size_t, default_buffer_size = 1024);
+ BOOST_ASIO_STATIC_CONSTANT(std::size_t, default_buffer_size = 1024);
 #endif
 
   /// Construct, passing the specified argument to initialise the next layer.

Modified: trunk/boost/asio/buffers_iterator.hpp
==============================================================================
--- trunk/boost/asio/buffers_iterator.hpp (original)
+++ trunk/boost/asio/buffers_iterator.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,11 +18,9 @@
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
 #include <iterator>
-#include <boost/assert.hpp>
-#include <boost/detail/workaround.hpp>
-#include <boost/type_traits/is_convertible.hpp>
-#include <boost/type_traits/add_const.hpp>
 #include <boost/asio/buffer.hpp>
+#include <boost/asio/detail/assert.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -41,7 +39,7 @@
     template <typename ByteType>
     struct byte_type
     {
- typedef typename boost::add_const<ByteType>::type type;
+ typedef typename add_const<ByteType>::type type;
     };
   };
 
@@ -61,8 +59,9 @@
   {
     enum
     {
- is_mutable = boost::is_convertible<
- typename BufferSequence::value_type, mutable_buffer>::value
+ is_mutable = is_convertible<
+ typename BufferSequence::value_type,
+ mutable_buffer>::value
     };
     typedef buffers_iterator_types_helper<is_mutable> helper;
     typedef typename helper::buffer_type buffer_type;
@@ -127,9 +126,9 @@
 
   /// Construct an iterator representing the beginning of the buffers' data.
   static buffers_iterator begin(const BufferSequence& buffers)
-#if BOOST_WORKAROUND(__GNUC__, == 4) && BOOST_WORKAROUND(__GNUC_MINOR__, == 3)
+#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
     __attribute__ ((__noinline__))
-#endif
+#endif // defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
   {
     buffers_iterator new_iter;
     new_iter.begin_ = buffers.begin();
@@ -147,9 +146,9 @@
 
   /// Construct an iterator representing the end of the buffers' data.
   static buffers_iterator end(const BufferSequence& buffers)
-#if BOOST_WORKAROUND(__GNUC__, == 4) && BOOST_WORKAROUND(__GNUC_MINOR__, == 3)
+#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
     __attribute__ ((__noinline__))
-#endif
+#endif // defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
   {
     buffers_iterator new_iter;
     new_iter.begin_ = buffers.begin();
@@ -314,7 +313,7 @@
   // Increment the iterator.
   void increment()
   {
- BOOST_ASSERT(current_ != end_ && "iterator out of bounds");
+ BOOST_ASIO_ASSERT(current_ != end_ && "iterator out of bounds");
     ++position_;
 
     // Check if the increment can be satisfied by the current buffer.
@@ -337,7 +336,7 @@
   // Decrement the iterator.
   void decrement()
   {
- BOOST_ASSERT(position_ > 0 && "iterator out of bounds");
+ BOOST_ASIO_ASSERT(position_ > 0 && "iterator out of bounds");
     --position_;
 
     // Check if the decrement can be satisfied by the current buffer.
@@ -369,7 +368,7 @@
   {
     if (n > 0)
     {
- BOOST_ASSERT(current_ != end_ && "iterator out of bounds");
+ BOOST_ASIO_ASSERT(current_ != end_ && "iterator out of bounds");
       for (;;)
       {
         std::ptrdiff_t current_buffer_balance
@@ -392,7 +391,7 @@
         // next iteration of this loop.
         if (++current_ == end_)
         {
- BOOST_ASSERT(n == 0 && "iterator out of bounds");
+ BOOST_ASIO_ASSERT(n == 0 && "iterator out of bounds");
           current_buffer_ = buffer_type();
           current_buffer_position_ = 0;
           return;
@@ -404,7 +403,7 @@
     else if (n < 0)
     {
       std::size_t abs_n = -n;
- BOOST_ASSERT(position_ >= abs_n && "iterator out of bounds");
+ BOOST_ASIO_ASSERT(position_ >= abs_n && "iterator out of bounds");
       for (;;)
       {
         // Check if the advance can be satisfied by the current buffer.
@@ -422,7 +421,7 @@
         // Check if we've reached the beginning of the buffers.
         if (current_ == begin_)
         {
- BOOST_ASSERT(abs_n == 0 && "iterator out of bounds");
+ BOOST_ASIO_ASSERT(abs_n == 0 && "iterator out of bounds");
           current_buffer_position_ = 0;
           return;
         }

Modified: trunk/boost/asio/deadline_timer.hpp
==============================================================================
--- trunk/boost/asio/deadline_timer.hpp (original)
+++ trunk/boost/asio/deadline_timer.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,6 +16,10 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \
+ || defined(GENERATING_DOCUMENTATION)
+
 #include <boost/asio/detail/socket_types.hpp> // Must come before posix_time.
 #include <boost/asio/basic_deadline_timer.hpp>
 
@@ -32,4 +36,7 @@
 } // namespace asio
 } // namespace boost
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ // || defined(GENERATING_DOCUMENTATION)
+
 #endif // BOOST_ASIO_DEADLINE_TIMER_HPP

Modified: trunk/boost/asio/deadline_timer_service.hpp
==============================================================================
--- trunk/boost/asio/deadline_timer_service.hpp (original)
+++ trunk/boost/asio/deadline_timer_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,6 +16,10 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \
+ || defined(GENERATING_DOCUMENTATION)
+
 #include <cstddef>
 #include <boost/asio/async_result.hpp>
 #include <boost/asio/detail/deadline_timer_service.hpp>
@@ -163,4 +167,7 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ // || defined(GENERATING_DOCUMENTATION)
+
 #endif // BOOST_ASIO_DEADLINE_TIMER_SERVICE_HPP

Added: trunk/boost/asio/detail/addressof.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/detail/addressof.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -0,0 +1,40 @@
+//
+// detail/addressof.hpp
+// ~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_ADDRESSOF_HPP
+#define BOOST_ASIO_DETAIL_ADDRESSOF_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+# include <memory>
+#else // defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+# include <boost/utility/addressof.hpp>
+#endif // defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+#if defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+using std::addressof;
+#else // defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+using boost::addressof;
+#endif // defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#endif // BOOST_ASIO_DETAIL_ADDRESSOF_HPP

Added: trunk/boost/asio/detail/assert.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/detail/assert.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -0,0 +1,32 @@
+//
+// detail/assert.hpp
+// ~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_ASSERT_HPP
+#define BOOST_ASIO_DETAIL_ASSERT_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+# include <boost/assert.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+# include <cassert>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+# define BOOST_ASIO_ASSERT(expr) BOOST_ASSERT(expr)
+#else // defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+# define BOOST_ASIO_ASSERT(expr) assert(expr)
+#endif // defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+
+#endif // BOOST_ASIO_DETAIL_ASSERT_HPP

Modified: trunk/boost/asio/detail/atomic_count.hpp
==============================================================================
--- trunk/boost/asio/detail/atomic_count.hpp (original)
+++ trunk/boost/asio/detail/atomic_count.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 // Nothing to include.
 #elif defined(BOOST_ASIO_HAS_STD_ATOMIC)
 # include <atomic>
@@ -29,7 +29,7 @@
 namespace asio {
 namespace detail {
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 typedef long atomic_count;
 inline void increment(atomic_count& a, long b) { a += b; }
 #elif defined(BOOST_ASIO_HAS_STD_ATOMIC)

Modified: trunk/boost/asio/detail/buffer_resize_guard.hpp
==============================================================================
--- trunk/boost/asio/detail/buffer_resize_guard.hpp (original)
+++ trunk/boost/asio/detail/buffer_resize_guard.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/limits.hpp>
+#include <boost/asio/detail/limits.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -39,8 +39,7 @@
   // Destructor rolls back the buffer resize unless commit was called.
   ~buffer_resize_guard()
   {
- if (old_size_
- != std::numeric_limits<size_t>::max BOOST_PREVENT_MACRO_SUBSTITUTION())
+ if (old_size_ != (std::numeric_limits<size_t>::max)())
     {
       buffer_.resize(old_size_);
     }
@@ -49,8 +48,7 @@
   // Commit the resize transaction.
   void commit()
   {
- old_size_
- = std::numeric_limits<size_t>::max BOOST_PREVENT_MACRO_SUBSTITUTION();
+ old_size_ = (std::numeric_limits<size_t>::max)();
   }
 
 private:

Modified: trunk/boost/asio/detail/buffer_sequence_adapter.hpp
==============================================================================
--- trunk/boost/asio/detail/buffer_sequence_adapter.hpp (original)
+++ trunk/boost/asio/detail/buffer_sequence_adapter.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -29,7 +29,7 @@
 class buffer_sequence_adapter_base
 {
 protected:
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   typedef WSABUF native_buffer_type;
 
   static void init_native_buffer(WSABUF& buf,
@@ -45,7 +45,7 @@
     buf.buf = const_cast<char*>(boost::asio::buffer_cast<const char*>(buffer));
     buf.len = static_cast<ULONG>(boost::asio::buffer_size(buffer));
   }
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   typedef iovec native_buffer_type;
 
   static void init_iov_base(void*& base, void* addr)
@@ -73,7 +73,7 @@
           boost::asio::buffer_cast<const void*>(buffer)));
     iov.iov_len = boost::asio::buffer_size(buffer);
   }
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 };
 
 // Helper class to translate buffers into the native buffer representation.

Modified: trunk/boost/asio/detail/buffered_stream_storage.hpp
==============================================================================
--- trunk/boost/asio/detail/buffered_stream_storage.hpp (original)
+++ trunk/boost/asio/detail/buffered_stream_storage.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <boost/asio/buffer.hpp>
-#include <boost/assert.hpp>
+#include <boost/asio/detail/assert.hpp>
 #include <cstddef>
 #include <cstring>
 #include <vector>
@@ -79,7 +79,7 @@
   // Resize the buffer to the specified length.
   void resize(size_type length)
   {
- BOOST_ASSERT(length <= capacity());
+ BOOST_ASIO_ASSERT(length <= capacity());
     if (begin_offset_ + length <= capacity())
     {
       end_offset_ = begin_offset_ + length;
@@ -102,7 +102,7 @@
   // Consume multiple bytes from the beginning of the buffer.
   void consume(size_type count)
   {
- BOOST_ASSERT(begin_offset_ + count <= end_offset_);
+ BOOST_ASIO_ASSERT(begin_offset_ + count <= end_offset_);
     begin_offset_ += count;
     if (empty())
       clear();

Modified: trunk/boost/asio/detail/chrono_time_traits.hpp
==============================================================================
--- trunk/boost/asio/detail/chrono_time_traits.hpp (original)
+++ trunk/boost/asio/detail/chrono_time_traits.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -15,7 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#include <boost/cstdint.hpp>
+#include <boost/asio/detail/cstdint.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -73,32 +73,32 @@
     {
     }
 
- boost::int64_t ticks() const
+ int64_t ticks() const
     {
       return d_.count();
     }
 
- boost::int64_t total_seconds() const
+ int64_t total_seconds() const
     {
       return duration_cast<1, 1>();
     }
 
- boost::int64_t total_milliseconds() const
+ int64_t total_milliseconds() const
     {
       return duration_cast<1, 1000>();
     }
 
- boost::int64_t total_microseconds() const
+ int64_t total_microseconds() const
     {
       return duration_cast<1, 1000000>();
     }
 
   private:
- template <boost::int64_t Num, boost::int64_t Den>
- boost::int64_t duration_cast() const
+ template <int64_t Num, int64_t Den>
+ int64_t duration_cast() const
     {
- const boost::int64_t num = period_type::num * Den;
- const boost::int64_t den = period_type::den * Num;
+ const int64_t num = period_type::num * Den;
+ const int64_t den = period_type::den * Num;
 
       if (num == 1 && den == 1)
         return ticks();

Modified: trunk/boost/asio/detail/completion_handler.hpp
==============================================================================
--- trunk/boost/asio/detail/completion_handler.hpp (original)
+++ trunk/boost/asio/detail/completion_handler.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -15,6 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/config.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
@@ -45,7 +46,7 @@
   {
     // Take ownership of the handler object.
     completion_handler* h(static_cast<completion_handler*>(base));
- ptr p = { boost::addressof(h->handler_), h, h };
+ ptr p = { boost::asio::detail::addressof(h->handler_), h, h };
 
     BOOST_ASIO_HANDLER_COMPLETION((h));
 
@@ -56,7 +57,7 @@
     // to ensure that any owning sub-object remains valid until after we have
     // deallocated the memory here.
     Handler handler(BOOST_ASIO_MOVE_CAST(Handler)(h->handler_));
- p.h = boost::addressof(handler);
+ p.h = boost::asio::detail::addressof(handler);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/config.hpp
==============================================================================
--- trunk/boost/asio/detail/config.hpp (original)
+++ trunk/boost/asio/detail/config.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -11,8 +11,22 @@
 #ifndef BOOST_ASIO_DETAIL_CONFIG_HPP
 #define BOOST_ASIO_DETAIL_CONFIG_HPP
 
-#include <boost/config.hpp>
-#include <boost/version.hpp>
+#if defined(BOOST_ASIO_STANDALONE)
+# define BOOST_ASIO_DISABLE_BOOST_ARRAY 1
+# define BOOST_ASIO_DISABLE_BOOST_ASSERT 1
+# define BOOST_ASIO_DISABLE_BOOST_BIND 1
+# define BOOST_ASIO_DISABLE_BOOST_CHRONO 1
+# define BOOST_ASIO_DISABLE_BOOST_DATE_TIME 1
+# define BOOST_ASIO_DISABLE_BOOST_LIMITS 1
+# define BOOST_ASIO_DISABLE_BOOST_REGEX 1
+# define BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT 1
+# define BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION 1
+# define BOOST_ASIO_DISABLE_BOOST_WORKAROUND 1
+#else // defined(BOOST_ASIO_STANDALONE)
+# include <boost/config.hpp>
+# include <boost/version.hpp>
+# define BOOST_ASIO_HAS_BOOST_CONFIG 1
+#endif // defined(BOOST_ASIO_STANDALONE)
 
 // Default to a header-only implementation. The user must specifically request
 // separate compilation by defining either BOOST_ASIO_SEPARATE_COMPILATION or
@@ -20,7 +34,7 @@
 #if !defined(BOOST_ASIO_HEADER_ONLY)
 # if !defined(BOOST_ASIO_SEPARATE_COMPILATION)
 # if !defined(BOOST_ASIO_DYN_LINK)
-# define BOOST_ASIO_HEADER_ONLY
+# define BOOST_ASIO_HEADER_ONLY 1
 # endif // !defined(BOOST_ASIO_DYN_LINK)
 # endif // !defined(BOOST_ASIO_SEPARATE_COMPILATION)
 #endif // !defined(BOOST_ASIO_HEADER_ONLY)
@@ -28,7 +42,7 @@
 #if defined(BOOST_ASIO_HEADER_ONLY)
 # define BOOST_ASIO_DECL inline
 #else // defined(BOOST_ASIO_HEADER_ONLY)
-# if defined(BOOST_HAS_DECLSPEC)
+# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
 // We need to import/export our code only if the user has specifically asked
 // for it by defining BOOST_ASIO_DYN_LINK.
 # if defined(BOOST_ASIO_DYN_LINK)
@@ -39,7 +53,7 @@
 # define BOOST_ASIO_DECL __declspec(dllimport)
 # endif // defined(BOOST_ASIO_SOURCE)
 # endif // defined(BOOST_ASIO_DYN_LINK)
-# endif // defined(BOOST_HAS_DECLSPEC)
+# endif // defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
 // If BOOST_ASIO_DECL isn't defined yet define it now.
@@ -47,16 +61,44 @@
 # define BOOST_ASIO_DECL
 #endif // !defined(BOOST_ASIO_DECL)
 
+// Microsoft Visual C++ detection.
+#if !defined(BOOST_ASIO_MSVC)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
+# define BOOST_ASIO_MSVC BOOST_MSVC
+# elif defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__EDG_VERSION__)
+# define BOOST_ASIO_MSVC _MSC_VER
+# endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
+#endif // defined(BOOST_ASIO_MSVC)
+
+// Clang / libc++ detection.
+#if defined(__clang__)
+# if (__cplusplus >= 201103)
+# if __has_include(<__config>)
+# include <__config>
+# if defined(_LIBCPP_VERSION)
+# define BOOST_ASIO_HAS_CLANG_LIBCXX 1
+# endif // defined(_LIBCPP_VERSION)
+# endif // __has_include(<__config>)
+# endif // (__cplusplus >= 201103)
+#endif // defined(__clang__)
+
 // Support move construction and assignment on compilers known to allow it.
-#if !defined(BOOST_ASIO_DISABLE_MOVE)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_ASIO_HAS_MOVE
-# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-#endif // !defined(BOOST_ASIO_DISABLE_MOVE)
+#if !defined(BOOST_ASIO_HAS_MOVE)
+# if !defined(BOOST_ASIO_DISABLE_MOVE)
+# if defined(__clang__)
+# if __has_feature(__cxx_rvalue_references__)
+# define BOOST_ASIO_HAS_MOVE 1
+# endif // __has_feature(__cxx_rvalue_references__)
+# endif // defined(__clang__)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_MOVE 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_MOVE)
+#endif // !defined(BOOST_ASIO_HAS_MOVE)
 
 // If BOOST_ASIO_MOVE_CAST isn't defined, and move support is available, define
 // BOOST_ASIO_MOVE_ARG and BOOST_ASIO_MOVE_CAST to take advantage of rvalue
@@ -78,7 +120,7 @@
 # else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
 # define BOOST_ASIO_MOVE_ARG(type) type
 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
-# elif defined(BOOST_MSVC)
+# elif defined(BOOST_ASIO_MSVC)
 # if (_MSC_VER >= 1400)
 # define BOOST_ASIO_MOVE_ARG(type) const type&
 # else // (_MSC_VER >= 1400)
@@ -91,31 +133,45 @@
 #endif // !defined_BOOST_ASIO_MOVE_CAST
 
 // Support variadic templates on compilers known to allow it.
-#if !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_ASIO_HAS_VARIADIC_TEMPLATES
-# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-#endif // !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
+#if !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
+# if !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
+# if defined(__clang__)
+# if __has_feature(__cxx_variadic_templates__)
+# define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
+# endif // __has_feature(__cxx_variadic_templates__)
+# endif // defined(__clang__)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
+#endif // !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
 
 // Standard library support for system errors.
-#if !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_ASIO_HAS_STD_SYSTEM_ERROR
-# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-#endif // !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
+# if !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
 
 // Compliant C++11 compilers put noexcept specifiers on error_category members.
 #if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
 # if (BOOST_VERSION >= 105300)
 # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT
+# elif defined(__clang__)
+# if __has_feature(__cxx_noexcept__)
+# define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
+# endif // __has_feature(__cxx_noexcept__)
 # elif defined(__GNUC__)
 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
@@ -129,73 +185,175 @@
 #endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
 
 // Standard library support for arrays.
-#if !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_ASIO_HAS_STD_ARRAY
-# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(BOOST_MSVC)
-# if (_MSC_VER >= 1600)
-# define BOOST_ASIO_HAS_STD_ARRAY
-# endif // (_MSC_VER >= 1600)
-# endif // defined(BOOST_MSVC)
-#endif // !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
+#if !defined(BOOST_ASIO_HAS_STD_ARRAY)
+# if !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_ARRAY 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_ARRAY 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# if defined(BOOST_ASIO_MSVC)
+# if (_MSC_VER >= 1600)
+# define BOOST_ASIO_HAS_STD_ARRAY 1
+# endif // (_MSC_VER >= 1600)
+# endif // defined(BOOST_ASIO_MSVC)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
+#endif // !defined(BOOST_ASIO_HAS_STD_ARRAY)
 
 // Standard library support for shared_ptr and weak_ptr.
-#if !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_ASIO_HAS_STD_SHARED_PTR
-# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(BOOST_MSVC)
-# if (_MSC_VER >= 1600)
-# define BOOST_ASIO_HAS_STD_SHARED_PTR
-# endif // (_MSC_VER >= 1600)
-# endif // defined(BOOST_MSVC)
-#endif // !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
+#if !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
+# if !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_SHARED_PTR 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_SHARED_PTR 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# if defined(BOOST_ASIO_MSVC)
+# if (_MSC_VER >= 1600)
+# define BOOST_ASIO_HAS_STD_SHARED_PTR 1
+# endif // (_MSC_VER >= 1600)
+# endif // defined(BOOST_ASIO_MSVC)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
+#endif // !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
 
 // Standard library support for atomic operations.
-#if !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_ASIO_HAS_STD_ATOMIC
-# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-#endif // !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
+#if !defined(BOOST_ASIO_HAS_STD_ATOMIC)
+# if !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_ATOMIC 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_ATOMIC 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
+#endif // !defined(BOOST_ASIO_HAS_STD_ATOMIC)
 
 // Standard library support for chrono. Some standard libraries (such as the
 // libstdc++ shipped with gcc 4.6) provide monotonic_clock as per early C++0x
 // drafts, rather than the eventually standardised name of steady_clock.
-#if !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_ASIO_HAS_STD_CHRONO
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
-# define BOOST_ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
-# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-#endif // !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
+#if !defined(BOOST_ASIO_HAS_STD_CHRONO)
+# if !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_CHRONO 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_CHRONO 1
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
+# define BOOST_ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK 1
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
+#endif // !defined(BOOST_ASIO_HAS_STD_CHRONO)
 
 // Boost support for chrono.
-#if !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
-# if (BOOST_VERSION >= 104700)
-# define BOOST_ASIO_HAS_BOOST_CHRONO
-# endif // (BOOST_VERSION >= 104700)
-#endif // !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
+#if !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
+# if (BOOST_VERSION >= 104700)
+# define BOOST_ASIO_HAS_BOOST_CHRONO 1
+# endif // (BOOST_VERSION >= 104700)
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
+
+// Boost support for the DateTime library.
+#if !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
+# define BOOST_ASIO_HAS_BOOST_DATE_TIME 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
+// Standard library support for addressof.
+#if !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+# if !defined(BOOST_ASIO_DISABLE_STD_ADDRESSOF)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_ADDRESSOF 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_ADDRESSOF 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_ADDRESSOF)
+#endif // !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+
+// Standard library support for the function class.
+#if !defined(BOOST_ASIO_HAS_STD_FUNCTION)
+# if !defined(BOOST_ASIO_DISABLE_STD_FUNCTION)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_FUNCTION 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_FUNCTION 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_FUNCTION)
+#endif // !defined(BOOST_ASIO_HAS_STD_FUNCTION)
+
+// Standard library support for type traits.
+#if !defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
+# if !defined(BOOST_ASIO_DISABLE_STD_TYPE_TRAITS)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_TYPE_TRAITS)
+#endif // !defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
+
+// Standard library support for the cstdint header.
+#if !defined(BOOST_ASIO_HAS_CSTDINT)
+# if !defined(BOOST_ASIO_DISABLE_CSTDINT)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_CSTDINT 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_CSTDINT 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_CSTDINT)
+#endif // !defined(BOOST_ASIO_HAS_CSTDINT)
+
+// Windows target.
+#if !defined(BOOST_ASIO_WINDOWS)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
+# define BOOST_ASIO_WINDOWS 1
+# elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
+# define BOOST_ASIO_WINDOWS 1
+# endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
+#endif // !defined(BOOST_ASIO_WINDOWS)
 
 // Windows: target OS version.
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
 # if defined(_MSC_VER) || defined(__BORLANDC__)
 # pragma message( \
@@ -233,55 +391,63 @@
 # error You must add -D__USE_W32_SOCKETS to your compiler options.
 # endif // !defined(__USE_W32_SOCKETS)
 # endif // defined(__CYGWIN__)
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 // Windows: minimise header inclusion.
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
 # if !defined(WIN32_LEAN_AND_MEAN)
 # define WIN32_LEAN_AND_MEAN
 # endif // !defined(WIN32_LEAN_AND_MEAN)
 # endif // !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 // Windows: suppress definition of "min" and "max" macros.
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if !defined(BOOST_ASIO_NO_NOMINMAX)
 # if !defined(NOMINMAX)
 # define NOMINMAX 1
 # endif // !defined(NOMINMAX)
 # endif // !defined(BOOST_ASIO_NO_NOMINMAX)
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 // Windows: IO Completion Ports.
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
-# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
-# if !defined(UNDER_CE)
-# if !defined(BOOST_ASIO_DISABLE_IOCP)
-# define BOOST_ASIO_HAS_IOCP 1
-# endif // !defined(BOOST_ASIO_DISABLE_IOCP)
-# endif // !defined(UNDER_CE)
-# endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_HAS_IOCP)
+# if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
+# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
+# if !defined(UNDER_CE)
+# if !defined(BOOST_ASIO_DISABLE_IOCP)
+# define BOOST_ASIO_HAS_IOCP 1
+# endif // !defined(BOOST_ASIO_DISABLE_IOCP)
+# endif // !defined(UNDER_CE)
+# endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
+# endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_HAS_IOCP)
 
 // Linux: epoll, eventfd and timerfd.
 #if defined(__linux__)
 # include <linux/version.h>
-# if !defined(BOOST_ASIO_DISABLE_EPOLL)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
-# define BOOST_ASIO_HAS_EPOLL 1
-# endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
-# endif // !defined(BOOST_ASIO_DISABLE_EVENTFD)
-# if !defined(BOOST_ASIO_DISABLE_EVENTFD)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
-# define BOOST_ASIO_HAS_EVENTFD 1
-# endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
-# endif // !defined(BOOST_ASIO_DISABLE_EVENTFD)
-# if defined(BOOST_ASIO_HAS_EPOLL)
-# if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
-# define BOOST_ASIO_HAS_TIMERFD 1
-# endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
-# endif // defined(BOOST_ASIO_HAS_EPOLL)
+# if !defined(BOOST_ASIO_HAS_EPOLL)
+# if !defined(BOOST_ASIO_DISABLE_EPOLL)
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
+# define BOOST_ASIO_HAS_EPOLL 1
+# endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
+# endif // !defined(BOOST_ASIO_DISABLE_EPOLL)
+# endif // !defined(BOOST_ASIO_HAS_EPOLL)
+# if !defined(BOOST_ASIO_HAS_EVENTFD)
+# if !defined(BOOST_ASIO_DISABLE_EVENTFD)
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+# define BOOST_ASIO_HAS_EVENTFD 1
+# endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+# endif // !defined(BOOST_ASIO_DISABLE_EVENTFD)
+# endif // !defined(BOOST_ASIO_HAS_EVENTFD)
+# if !defined(BOOST_ASIO_HAS_TIMERFD)
+# if defined(BOOST_ASIO_HAS_EPOLL)
+# if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
+# define BOOST_ASIO_HAS_TIMERFD 1
+# endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
+# endif // defined(BOOST_ASIO_HAS_EPOLL)
+# endif // !defined(BOOST_ASIO_HAS_TIMERFD)
 #endif // defined(__linux__)
 
 // Mac OS X, FreeBSD, NetBSD, OpenBSD: kqueue.
@@ -289,9 +455,11 @@
   || defined(__FreeBSD__) \
   || defined(__NetBSD__) \
   || defined(__OpenBSD__)
-# if !defined(BOOST_ASIO_DISABLE_KQUEUE)
-# define BOOST_ASIO_HAS_KQUEUE 1
-# endif // !defined(BOOST_ASIO_DISABLE_KQUEUE)
+# if !defined(BOOST_ASIO_HAS_KQUEUE)
+# if !defined(BOOST_ASIO_DISABLE_KQUEUE)
+# define BOOST_ASIO_HAS_KQUEUE 1
+# endif // !defined(BOOST_ASIO_DISABLE_KQUEUE)
+# endif // !defined(BOOST_ASIO_HAS_KQUEUE)
 #endif // (defined(__MACH__) && defined(__APPLE__))
        // || defined(__FreeBSD__)
        // || defined(__NetBSD__)
@@ -299,79 +467,257 @@
 
 // Solaris: /dev/poll.
 #if defined(__sun)
-# if !defined(BOOST_ASIO_DISABLE_DEV_POLL)
-# define BOOST_ASIO_HAS_DEV_POLL 1
-# endif // !defined(BOOST_ASIO_DISABLE_DEV_POLL)
+# if !defined(BOOST_ASIO_HAS_DEV_POLL)
+# if !defined(BOOST_ASIO_DISABLE_DEV_POLL)
+# define BOOST_ASIO_HAS_DEV_POLL 1
+# endif // !defined(BOOST_ASIO_DISABLE_DEV_POLL)
+# endif // !defined(BOOST_ASIO_HAS_DEV_POLL)
 #endif // defined(__sun)
 
 // Serial ports.
-#if defined(BOOST_ASIO_HAS_IOCP) \
- || !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-# if !defined(__SYMBIAN32__)
-# if !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
-# define BOOST_ASIO_HAS_SERIAL_PORT 1
-# endif // !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
-# endif // !defined(__SYMBIAN32__)
-#endif // defined(BOOST_ASIO_HAS_IOCP)
- // || !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_HAS_SERIAL_PORT)
+# if defined(BOOST_ASIO_HAS_IOCP) \
+ || !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+# if !defined(__SYMBIAN32__)
+# if !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
+# define BOOST_ASIO_HAS_SERIAL_PORT 1
+# endif // !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
+# endif // !defined(__SYMBIAN32__)
+# endif // defined(BOOST_ASIO_HAS_IOCP)
+ // || !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_HAS_SERIAL_PORT)
 
 // Windows: stream handles.
-#if !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
-# if defined(BOOST_ASIO_HAS_IOCP)
-# define BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE 1
-# endif // defined(BOOST_ASIO_HAS_IOCP)
-#endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
+#if !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
+# if !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
+# if defined(BOOST_ASIO_HAS_IOCP)
+# define BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE 1
+# endif // defined(BOOST_ASIO_HAS_IOCP)
+# endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
+#endif // !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
 
 // Windows: random access handles.
-#if !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
-# if defined(BOOST_ASIO_HAS_IOCP)
-# define BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE 1
-# endif // defined(BOOST_ASIO_HAS_IOCP)
-#endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
+#if !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
+# if !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
+# if defined(BOOST_ASIO_HAS_IOCP)
+# define BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE 1
+# endif // defined(BOOST_ASIO_HAS_IOCP)
+# endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
+#endif // !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
 
 // Windows: object handles.
-#if !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
-# if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
-# if !defined(UNDER_CE)
-# define BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE 1
-# endif // !defined(UNDER_CE)
-# endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
-#endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
+#if !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
+# if !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
+# if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
+# if !defined(UNDER_CE)
+# define BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE 1
+# endif // !defined(UNDER_CE)
+# endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
+# endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
+#endif // !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
 
 // Windows: OVERLAPPED wrapper.
-#if !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
-# if defined(BOOST_ASIO_HAS_IOCP)
-# define BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1
-# endif // defined(BOOST_ASIO_HAS_IOCP)
-#endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
+#if !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
+# if !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
+# if defined(BOOST_ASIO_HAS_IOCP)
+# define BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1
+# endif // defined(BOOST_ASIO_HAS_IOCP)
+# endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
+#endif // !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
 
 // POSIX: stream-oriented file descriptors.
-#if !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
-# if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-# define BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR 1
-# endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-#endif // !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
+#if !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+# if !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
+# if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+# define BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR 1
+# endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+# endif // !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
+#endif // !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
 
 // UNIX domain sockets.
-#if !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
-# if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-# define BOOST_ASIO_HAS_LOCAL_SOCKETS 1
-# endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-#endif // !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
+#if !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
+# if !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
+# if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+# define BOOST_ASIO_HAS_LOCAL_SOCKETS 1
+# endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+# endif // !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
+#endif // !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
 
 // Can use sigaction() instead of signal().
-#if !defined(BOOST_ASIO_DISABLE_SIGACTION)
-# if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-# define BOOST_ASIO_HAS_SIGACTION 1
-# endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-#endif // !defined(BOOST_ASIO_DISABLE_SIGACTION)
+#if !defined(BOOST_ASIO_HAS_SIGACTION)
+# if !defined(BOOST_ASIO_DISABLE_SIGACTION)
+# if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+# define BOOST_ASIO_HAS_SIGACTION 1
+# endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+# endif // !defined(BOOST_ASIO_DISABLE_SIGACTION)
+#endif // !defined(BOOST_ASIO_HAS_SIGACTION)
 
 // Can use signal().
-#if !defined(BOOST_ASIO_DISABLE_SIGNAL)
-# if !defined(UNDER_CE)
-# define BOOST_ASIO_HAS_SIGNAL 1
-# endif // !defined(UNDER_CE)
-#endif // !defined(BOOST_ASIO_DISABLE_SIGNAL)
+#if !defined(BOOST_ASIO_HAS_SIGNAL)
+# if !defined(BOOST_ASIO_DISABLE_SIGNAL)
+# if !defined(UNDER_CE)
+# define BOOST_ASIO_HAS_SIGNAL 1
+# endif // !defined(UNDER_CE)
+# endif // !defined(BOOST_ASIO_DISABLE_SIGNAL)
+#endif // !defined(BOOST_ASIO_HAS_SIGNAL)
+
+// Whether standard iostreams are disabled.
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_IOSTREAM)
+# define BOOST_ASIO_NO_IOSTREAM 1
+# endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
+
+// Whether exception handling is disabled.
+#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_EXCEPTIONS)
+# define BOOST_ASIO_NO_EXCEPTIONS 1
+# endif // !defined(BOOST_NO_EXCEPTIONS)
+#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
+
+// Whether the typeid operator is supported.
+#if !defined(BOOST_ASIO_NO_TYPEID)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_TYPEID)
+# define BOOST_ASIO_NO_TYPEID 1
+# endif // !defined(BOOST_NO_TYPEID)
+#endif // !defined(BOOST_ASIO_NO_TYPEID)
+
+// On POSIX (and POSIX-like) platforms we need to include unistd.h in order to
+// get access to the various platform feature macros, e.g. to be able to test
+// for threads support.
+#if !defined(BOOST_ASIO_HAS_UNISTD_H)
+# if !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
+# if defined(unix) \
+ || defined(__unix) \
+ || defined(_XOPEN_SOURCE) \
+ || defined(_POSIX_SOURCE) \
+ || (defined(__MACH__) && defined(__APPLE__)) \
+ || defined(__FreeBSD__) \
+ || defined(__NetBSD__) \
+ || defined(__OpenBSD__) \
+ || defined(__linux__)
+# define BOOST_ASIO_HAS_UNISTD_H 1
+# endif
+# endif // !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
+#endif // !defined(BOOST_ASIO_HAS_UNISTD_H)
+#if defined(BOOST_ASIO_HAS_UNISTD_H)
+# include <unistd.h>
+#endif // defined(BOOST_ASIO_HAS_UNISTD_H)
+
+// Threads.
+#if !defined(BOOST_ASIO_HAS_THREADS)
+# if !defined(BOOST_ASIO_DISABLE_THREADS)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
+# define BOOST_ASIO_HAS_THREADS 1
+# elif defined(_MSC_VER) && defined(_MT)
+# define BOOST_ASIO_HAS_THREADS 1
+# elif defined(__BORLANDC__) && defined(__MT__)
+# define BOOST_ASIO_HAS_THREADS 1
+# elif defined(_POSIX_THREADS)
+# define BOOST_ASIO_HAS_THREADS 1
+# endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
+# endif // !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // !defined(BOOST_ASIO_HAS_THREADS)
+
+// POSIX threads.
+#if !defined(BOOST_ASIO_HAS_PTHREADS)
+# if defined(BOOST_ASIO_HAS_THREADS)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
+# define BOOST_ASIO_HAS_PTHREADS 1
+# elif defined(_POSIX_THREADS)
+# define BOOST_ASIO_HAS_PTHREADS 1
+# endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
+# endif // defined(BOOST_ASIO_HAS_THREADS)
+#endif // !defined(BOOST_ASIO_HAS_PTHREADS)
+
+// Helper to prevent macro expansion.
+#define BOOST_ASIO_PREVENT_MACRO_SUBSTITUTION
+
+// Helper to define in-class constants.
+#if !defined(BOOST_ASIO_STATIC_CONSTANT)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
+# define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
+ BOOST_STATIC_CONSTANT(type, assignment)
+# else // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
+# define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
+ static const type assignment
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
+#endif // !defined(BOOST_ASIO_STATIC_CONSTANT)
+
+// Boost array library.
+#if !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
+# define BOOST_ASIO_HAS_BOOST_ARRAY 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+// Boost assert macro.
+#if !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
+# define BOOST_ASIO_HAS_BOOST_ASSERT 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+
+// Boost limits header.
+#if !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
+# define BOOST_ASIO_HAS_BOOST_LIMITS 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
+
+// Boost throw_exception function.
+#if !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
+# define BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
+
+// Boost regex library.
+#if !defined(BOOST_ASIO_HAS_BOOST_REGEX)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
+# define BOOST_ASIO_HAS_BOOST_REGEX 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_REGEX)
+
+// Boost bind function.
+#if !defined(BOOST_ASIO_HAS_BOOST_BIND)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
+# define BOOST_ASIO_HAS_BOOST_BIND 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+// Boost's BOOST_WORKAROUND macro.
+#if !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
+# define BOOST_ASIO_HAS_BOOST_WORKAROUND 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
+
+// Microsoft Visual C++'s secure C runtime library.
+#if !defined(BOOST_ASIO_HAS_SECURE_RTL)
+# if !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
+# if defined(BOOST_ASIO_MSVC) \
+ && (BOOST_ASIO_MSVC >= 1400) \
+ && !defined(UNDER_CE)
+# define BOOST_ASIO_HAS_SECURE_RTL 1
+# endif // defined(BOOST_ASIO_MSVC)
+ // && (BOOST_ASIO_MSVC >= 1400)
+ // && !defined(UNDER_CE)
+# endif // !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
+#endif // !defined(BOOST_ASIO_HAS_SECURE_RTL)
+
+// Handler hooking. Disabled for ancient Borland C++ and gcc compilers.
+#if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
+# if !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
+# if defined(__GNUC__)
+# if (__GNUC__ >= 3)
+# define BOOST_ASIO_HAS_HANDLER_HOOKS 1
+# endif // (__GNUC__ >= 3)
+# elif !defined(__BORLANDC__)
+# define BOOST_ASIO_HAS_HANDLER_HOOKS 1
+# endif // !defined(__BORLANDC__)
+# endif // !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
+#endif // !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
 
 // Support for the __thread keyword extension.
 #if !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)

Modified: trunk/boost/asio/detail/consuming_buffers.hpp
==============================================================================
--- trunk/boost/asio/detail/consuming_buffers.hpp (original)
+++ trunk/boost/asio/detail/consuming_buffers.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,9 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
-#include <boost/iterator.hpp>
-#include <boost/limits.hpp>
+#include <iterator>
 #include <boost/asio/buffer.hpp>
+#include <boost/asio/detail/limits.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -30,9 +30,23 @@
 // A proxy iterator for a sub-range in a list of buffers.
 template <typename Buffer, typename Buffer_Iterator>
 class consuming_buffers_iterator
- : public boost::iterator<std::forward_iterator_tag, const Buffer>
 {
 public:
+ /// The type used for the distance between two iterators.
+ typedef std::ptrdiff_t difference_type;
+
+ /// The type of the value pointed to by the iterator.
+ typedef Buffer value_type;
+
+ /// The type of the result of applying operator->() to the iterator.
+ typedef const Buffer* pointer;
+
+ /// The type of the result of applying operator*() to the iterator.
+ typedef const Buffer& reference;
+
+ /// The iterator category.
+ typedef std::forward_iterator_tag iterator_category;
+
   // Default constructor creates an end iterator.
   consuming_buffers_iterator()
     : at_end_(true)

Added: trunk/boost/asio/detail/cstdint.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/detail/cstdint.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -0,0 +1,48 @@
+//
+// detail/cstdint.hpp
+// ~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_CSTDINT_HPP
+#define BOOST_ASIO_DETAIL_CSTDINT_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_CSTDINT)
+# include <cstdint>
+#else // defined(BOOST_ASIO_HAS_CSTDINT)
+# include <boost/cstdint.hpp>
+#endif // defined(BOOST_ASIO_HAS_CSTDINT)
+
+namespace boost {
+namespace asio {
+
+#if defined(BOOST_ASIO_HAS_CSTDINT)
+using std::int16_t;
+using std::uint16_t;
+using std::int32_t;
+using std::uint32_t;
+using std::int64_t;
+using std::uint64_t;
+#else // defined(BOOST_ASIO_HAS_CSTDINT)
+using boost::int16_t;
+using boost::uint16_t;
+using boost::int32_t;
+using boost::uint32_t;
+using boost::int64_t;
+using boost::uint64_t;
+#endif // defined(BOOST_ASIO_HAS_CSTDINT)
+
+} // namespace asio
+} // namespace boost
+
+#endif // BOOST_ASIO_DETAIL_CSTDINT_HPP

Modified: trunk/boost/asio/detail/deadline_timer_service.hpp
==============================================================================
--- trunk/boost/asio/detail/deadline_timer_service.hpp (original)
+++ trunk/boost/asio/detail/deadline_timer_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,6 +19,7 @@
 #include <cstddef>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
@@ -174,7 +175,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef wait_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);

Modified: trunk/boost/asio/detail/descriptor_ops.hpp
==============================================================================
--- trunk/boost/asio/detail/descriptor_ops.hpp (original)
+++ trunk/boost/asio/detail/descriptor_ops.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <cstddef>
 #include <boost/system/error_code.hpp>
@@ -110,6 +110,6 @@
 # include <boost/asio/detail/impl/descriptor_ops.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_DESCRIPTOR_OPS_HPP

Modified: trunk/boost/asio/detail/descriptor_read_op.hpp
==============================================================================
--- trunk/boost/asio/detail/descriptor_read_op.hpp (original)
+++ trunk/boost/asio/detail/descriptor_read_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,9 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/descriptor_ops.hpp>
@@ -81,7 +81,7 @@
   {
     // Take ownership of the handler object.
     descriptor_read_op* o(static_cast<descriptor_read_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -93,7 +93,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.
@@ -116,6 +116,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_DESCRIPTOR_READ_OP_HPP

Modified: trunk/boost/asio/detail/descriptor_write_op.hpp
==============================================================================
--- trunk/boost/asio/detail/descriptor_write_op.hpp (original)
+++ trunk/boost/asio/detail/descriptor_write_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,9 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/descriptor_ops.hpp>
@@ -81,7 +81,7 @@
   {
     // Take ownership of the handler object.
     descriptor_write_op* o(static_cast<descriptor_write_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -93,7 +93,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.
@@ -116,6 +116,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_DESCRIPTOR_WRITE_OP_HPP

Modified: trunk/boost/asio/detail/dev_poll_reactor.hpp
==============================================================================
--- trunk/boost/asio/detail/dev_poll_reactor.hpp (original)
+++ trunk/boost/asio/detail/dev_poll_reactor.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,12 +19,12 @@
 
 #if defined(BOOST_ASIO_HAS_DEV_POLL)
 
-#include <boost/limits.hpp>
 #include <cstddef>
 #include <vector>
 #include <sys/devpoll.h>
 #include <boost/asio/detail/dev_poll_reactor_fwd.hpp>
 #include <boost/asio/detail/hash_map.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/mutex.hpp>
 #include <boost/asio/detail/op_queue.hpp>
 #include <boost/asio/detail/reactor_op.hpp>

Modified: trunk/boost/asio/detail/epoll_reactor.hpp
==============================================================================
--- trunk/boost/asio/detail/epoll_reactor.hpp (original)
+++ trunk/boost/asio/detail/epoll_reactor.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,11 +19,10 @@
 
 #if defined(BOOST_ASIO_HAS_EPOLL)
 
-#include <boost/cstdint.hpp>
-#include <boost/limits.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/detail/atomic_count.hpp>
 #include <boost/asio/detail/epoll_reactor_fwd.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/mutex.hpp>
 #include <boost/asio/detail/object_pool.hpp>
 #include <boost/asio/detail/op_queue.hpp>
@@ -60,7 +59,7 @@
     mutex mutex_;
     epoll_reactor* reactor_;
     int descriptor_;
- boost::uint32_t registered_events_;
+ uint32_t registered_events_;
     op_queue<reactor_op> op_queue_[max_ops];
     bool shutdown_;
 

Modified: trunk/boost/asio/detail/event.hpp
==============================================================================
--- trunk/boost/asio/detail/event.hpp (original)
+++ trunk/boost/asio/detail/event.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,11 +17,11 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 # include <boost/asio/detail/null_event.hpp>
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 # include <boost/asio/detail/win_event.hpp>
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 # include <boost/asio/detail/posix_event.hpp>
 #else
 # error Only Windows and POSIX are supported!
@@ -31,11 +31,11 @@
 namespace asio {
 namespace detail {
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 typedef null_event event;
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 typedef win_event event;
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 typedef posix_event event;
 #endif
 

Modified: trunk/boost/asio/detail/fd_set_adapter.hpp
==============================================================================
--- trunk/boost/asio/detail/fd_set_adapter.hpp (original)
+++ trunk/boost/asio/detail/fd_set_adapter.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -23,7 +23,7 @@
 namespace asio {
 namespace detail {
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 typedef win_fd_set_adapter fd_set_adapter;
 #else
 typedef posix_fd_set_adapter fd_set_adapter;

Modified: trunk/boost/asio/detail/fenced_block.hpp
==============================================================================
--- trunk/boost/asio/detail/fenced_block.hpp (original)
+++ trunk/boost/asio/detail/fenced_block.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,8 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) \
- || defined(BOOST_ASIO_DISABLE_THREADS) \
+#if !defined(BOOST_ASIO_HAS_THREADS) \
   || defined(BOOST_ASIO_DISABLE_FENCED_BLOCK)
 # include <boost/asio/detail/null_fenced_block.hpp>
 #elif defined(__MACH__) && defined(__APPLE__)
@@ -37,7 +36,7 @@
   && !defined(__INTEL_COMPILER) && !defined(__ICL) \
   && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__)
 # include <boost/asio/detail/gcc_sync_fenced_block.hpp>
-#elif defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#elif defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 # include <boost/asio/detail/win_fenced_block.hpp>
 #else
 # include <boost/asio/detail/null_fenced_block.hpp>
@@ -47,8 +46,7 @@
 namespace asio {
 namespace detail {
 
-#if !defined(BOOST_HAS_THREADS) \
- || defined(BOOST_ASIO_DISABLE_THREADS) \
+#if !defined(BOOST_ASIO_HAS_THREADS) \
   || defined(BOOST_ASIO_DISABLE_FENCED_BLOCK)
 typedef null_fenced_block fenced_block;
 #elif defined(__MACH__) && defined(__APPLE__)
@@ -67,7 +65,7 @@
   && !defined(__INTEL_COMPILER) && !defined(__ICL) \
   && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__)
 typedef gcc_sync_fenced_block fenced_block;
-#elif defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#elif defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 typedef win_fenced_block fenced_block;
 #else
 typedef null_fenced_block fenced_block;

Added: trunk/boost/asio/detail/function.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/detail/function.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -0,0 +1,40 @@
+//
+// detail/function.hpp
+// ~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_FUNCTION_HPP
+#define BOOST_ASIO_DETAIL_FUNCTION_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_STD_FUNCTION)
+# include <functional>
+#else // defined(BOOST_ASIO_HAS_STD_FUNCTION)
+# include <boost/function.hpp>
+#endif // defined(BOOST_ASIO_HAS_STD_FUNCTION)
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+#if defined(BOOST_ASIO_HAS_STD_FUNCTION)
+using std::function;
+#else // defined(BOOST_ASIO_HAS_STD_FUNCTION)
+using boost::function;
+#endif // defined(BOOST_ASIO_HAS_STD_FUNCTION)
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#endif // BOOST_ASIO_DETAIL_FUNCTION_HPP

Modified: trunk/boost/asio/detail/handler_alloc_helpers.hpp
==============================================================================
--- trunk/boost/asio/detail/handler_alloc_helpers.hpp (original)
+++ trunk/boost/asio/detail/handler_alloc_helpers.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,8 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/detail/workaround.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/handler_alloc_hook.hpp>
 
@@ -31,24 +30,22 @@
 template <typename Handler>
 inline void* allocate(std::size_t s, Handler& h)
 {
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \
- || BOOST_WORKAROUND(__GNUC__, < 3)
+#if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
   return ::operator new(s);
 #else
   using boost::asio::asio_handler_allocate;
- return asio_handler_allocate(s, boost::addressof(h));
+ return asio_handler_allocate(s, boost::asio::detail::addressof(h));
 #endif
 }
 
 template <typename Handler>
 inline void deallocate(void* p, std::size_t s, Handler& h)
 {
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \
- || BOOST_WORKAROUND(__GNUC__, < 3)
+#if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
   ::operator delete(p);
 #else
   using boost::asio::asio_handler_deallocate;
- asio_handler_deallocate(p, s, boost::addressof(h));
+ asio_handler_deallocate(p, s, boost::asio::detail::addressof(h));
 #endif
 }
 

Modified: trunk/boost/asio/detail/handler_cont_helpers.hpp
==============================================================================
--- trunk/boost/asio/detail/handler_cont_helpers.hpp (original)
+++ trunk/boost/asio/detail/handler_cont_helpers.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/handler_continuation_hook.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -29,12 +29,12 @@
 template <typename Context>
 inline bool is_continuation(Context& context)
 {
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \
- || BOOST_WORKAROUND(__GNUC__, < 3)
+#if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
   return false;
 #else
   using boost::asio::asio_handler_is_continuation;
- return asio_handler_is_continuation(boost::addressof(context));
+ return asio_handler_is_continuation(
+ boost::asio::detail::addressof(context));
 #endif
 }
 

Modified: trunk/boost/asio/detail/handler_invoke_helpers.hpp
==============================================================================
--- trunk/boost/asio/detail/handler_invoke_helpers.hpp (original)
+++ trunk/boost/asio/detail/handler_invoke_helpers.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,8 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/detail/workaround.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/handler_invoke_hook.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -30,26 +29,24 @@
 template <typename Function, typename Context>
 inline void invoke(Function& function, Context& context)
 {
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \
- || BOOST_WORKAROUND(__GNUC__, < 3)
+#if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
   Function tmp(function);
   tmp();
 #else
   using boost::asio::asio_handler_invoke;
- asio_handler_invoke(function, boost::addressof(context));
+ asio_handler_invoke(function, boost::asio::detail::addressof(context));
 #endif
 }
 
 template <typename Function, typename Context>
 inline void invoke(const Function& function, Context& context)
 {
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \
- || BOOST_WORKAROUND(__GNUC__, < 3)
+#if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
   Function tmp(function);
   tmp();
 #else
   using boost::asio::asio_handler_invoke;
- asio_handler_invoke(function, boost::addressof(context));
+ asio_handler_invoke(function, boost::asio::detail::addressof(context));
 #endif
 }
 

Modified: trunk/boost/asio/detail/handler_tracking.hpp
==============================================================================
--- trunk/boost/asio/detail/handler_tracking.hpp (original)
+++ trunk/boost/asio/detail/handler_tracking.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,8 +18,8 @@
 #include <boost/asio/detail/config.hpp>
 
 #if defined(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
-# include <boost/cstdint.hpp>
 # include <boost/system/error_code.hpp>
+# include <boost/asio/detail/cstdint.hpp>
 # include <boost/asio/detail/static_mutex.hpp>
 # include <boost/asio/detail/tss_ptr.hpp>
 #endif // defined(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
@@ -44,7 +44,7 @@
     // Only the handler_tracking class will have access to the id.
     friend class handler_tracking;
     friend class completion;
- boost::uint64_t id_;
+ uint64_t id_;
 
   protected:
     // Constructor initialises with no id.
@@ -94,7 +94,7 @@
 
   private:
     friend class handler_tracking;
- boost::uint64_t id_;
+ uint64_t id_;
     bool invoked_;
     completion* next_;
   };

Modified: trunk/boost/asio/detail/handler_type_requirements.hpp
==============================================================================
--- trunk/boost/asio/detail/handler_type_requirements.hpp (original)
+++ trunk/boost/asio/detail/handler_type_requirements.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -37,13 +37,13 @@
 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
 # endif // defined(__GNUC__)
-# if defined(BOOST_MSVC)
+# if defined(BOOST_ASIO_MSVC)
 # if (_MSC_VER >= 1600)
 # define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1
 # endif // (_MSC_VER >= 1600)
-# endif // defined(BOOST_MSVC)
+# endif // defined(BOOST_ASIO_MSVC)
 # if defined(__clang__)
-# if __has_feature(cxx_static_assert)
+# if __has_feature(__cxx_static_assert__)
 # define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1
 # endif // __has_feature(cxx_static_assert)
 # endif // defined(__clang__)

Modified: trunk/boost/asio/detail/hash_map.hpp
==============================================================================
--- trunk/boost/asio/detail/hash_map.hpp (original)
+++ trunk/boost/asio/detail/hash_map.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,14 +16,14 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/assert.hpp>
 #include <list>
 #include <utility>
+#include <boost/asio/detail/assert.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # include <boost/asio/detail/socket_types.hpp>
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -42,12 +42,12 @@
     + (reinterpret_cast<std::size_t>(p) >> 3);
 }
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 inline std::size_t calculate_hash_value(SOCKET s)
 {
   return static_cast<std::size_t>(s);
 }
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 // Note: assumes K and V are POD types.
 template <typename K, typename V>
@@ -180,7 +180,7 @@
   // Erase an entry from the map.
   void erase(iterator it)
   {
- BOOST_ASSERT(it != values_.end());
+ BOOST_ASIO_ASSERT(it != values_.end());
 
     size_t bucket = calculate_hash_value(it->first) % num_buckets_;
     bool is_first = (it == buckets_[bucket].first);

Modified: trunk/boost/asio/detail/impl/descriptor_ops.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/descriptor_ops.ipp (original)
+++ trunk/boost/asio/detail/impl/descriptor_ops.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -20,7 +20,7 @@
 #include <boost/asio/detail/descriptor_ops.hpp>
 #include <boost/asio/error.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -444,6 +444,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_DESCRIPTOR_OPS_IPP

Modified: trunk/boost/asio/detail/impl/dev_poll_reactor.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/dev_poll_reactor.ipp (original)
+++ trunk/boost/asio/detail/impl/dev_poll_reactor.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,8 +19,8 @@
 
 #if defined(BOOST_ASIO_HAS_DEV_POLL)
 
-#include <boost/assert.hpp>
 #include <boost/asio/detail/dev_poll_reactor.hpp>
+#include <boost/asio/detail/assert.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/error.hpp>
 
@@ -122,7 +122,7 @@
 
     // The ops op_queue will always be empty because the fork_helper's set()
     // member function never returns false.
- BOOST_ASSERT(ops.empty());
+ BOOST_ASIO_ASSERT(ops.empty());
   }
 }
 

Modified: trunk/boost/asio/detail/impl/eventfd_select_interrupter.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/eventfd_select_interrupter.ipp (original)
+++ trunk/boost/asio/detail/impl/eventfd_select_interrupter.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -28,6 +28,7 @@
 #else // __GLIBC__ == 2 && __GLIBC_MINOR__ < 8
 # include <sys/eventfd.h>
 #endif // __GLIBC__ == 2 && __GLIBC_MINOR__ < 8
+#include <boost/asio/detail/cstdint.hpp>
 #include <boost/asio/detail/eventfd_select_interrupter.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/error.hpp>

Modified: trunk/boost/asio/detail/impl/handler_tracking.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/handler_tracking.ipp (original)
+++ trunk/boost/asio/detail/impl/handler_tracking.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -23,13 +23,21 @@
 #include <cstdio>
 #include <boost/asio/detail/handler_tracking.hpp>
 
-#include <boost/asio/detail/push_options.hpp>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
-#include <boost/asio/detail/pop_options.hpp>
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/time_traits.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# if defined(BOOST_ASIO_HAS_STD_CHRONO)
+# include <chrono>
+# elif defined(BOOST_ASIO_HAS_BOOST_CHRONO)
+# include <boost/chrono/system_clocks.hpp>
+# endif
+# include <boost/asio/detail/chrono_time_traits.hpp>
+# include <boost/asio/wait_traits.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
 
-#if !defined(BOOST_WINDOWS)
+#if !defined(BOOST_ASIO_WINDOWS)
 # include <unistd.h>
-#endif // !defined(BOOST_WINDOWS)
+#endif // !defined(BOOST_ASIO_WINDOWS)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -37,10 +45,37 @@
 namespace asio {
 namespace detail {
 
+struct handler_tracking_timestamp
+{
+ uint64_t seconds;
+ uint64_t microseconds;
+
+ handler_tracking_timestamp()
+ {
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
+ boost::posix_time::time_duration now =
+ boost::posix_time::microsec_clock::universal_time() - epoch;
+#elif defined(BOOST_ASIO_HAS_STD_CHRONO)
+ typedef chrono_time_traits<std::chrono::system_clock,
+ boost::asio::wait_traits<std::chrono::system_clock> > traits_helper;
+ traits_helper::posix_time_duration now(
+ std::chrono::system_clock::now().time_since_epoch());
+#elif defined(BOOST_ASIO_HAS_BOOST_CHRONO)
+ typedef chrono_time_traits<boost::chrono::system_clock,
+ boost::asio::wait_traits<boost::chrono::system_clock> > traits_helper;
+ traits_helper::posix_time_duration now(
+ boost::chrono::system_clock::now().time_since_epoch());
+#endif
+ seconds = static_cast<uint64_t>(now.total_seconds());
+ microseconds = static_cast<uint64_t>(now.total_microseconds() % 1000000);
+ }
+};
+
 struct handler_tracking::tracking_state
 {
   static_mutex mutex_;
- boost::uint64_t next_id_;
+ uint64_t next_id_;
   tss_ptr<completion>* current_completion_;
 };
 
@@ -70,22 +105,19 @@
   h->id_ = state->next_id_++;
   lock.unlock();
 
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
- boost::uint64_t current_id = 0;
+ uint64_t current_id = 0;
   if (completion* current_completion = *state->current_completion_)
     current_id = current_completion->id_;
 
   write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
       "@asio|%I64u.%06I64u|%I64u*%I64u|%.20s@%p.%.50s\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       "@asio|%llu.%06llu|%llu*%llu|%.20s@%p.%.50s\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000),
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds,
       current_id, h->id_, object_type, object, op_name);
 }
 
@@ -101,18 +133,15 @@
 {
   if (id_)
   {
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
     write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
         "@asio|%I64u.%06I64u|%c%I64u|\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
         "@asio|%llu.%06llu|%c%llu|\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000),
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds,
         invoked_ ? '!' : '~', id_);
   }
 
@@ -121,18 +150,15 @@
 
 void handler_tracking::completion::invocation_begin()
 {
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
   write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
       "@asio|%I64u.%06I64u|>%I64u|\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       "@asio|%llu.%06llu|>%llu|\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000), id_);
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds);
 
   invoked_ = true;
 }
@@ -140,18 +166,15 @@
 void handler_tracking::completion::invocation_begin(
     const boost::system::error_code& ec)
 {
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
   write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
       "@asio|%I64u.%06I64u|>%I64u|ec=%.20s:%d\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       "@asio|%llu.%06llu|>%llu|ec=%.20s:%d\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000),
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds,
       id_, ec.category().name(), ec.value());
 
   invoked_ = true;
@@ -160,20 +183,17 @@
 void handler_tracking::completion::invocation_begin(
     const boost::system::error_code& ec, std::size_t bytes_transferred)
 {
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
   write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
       "@asio|%I64u.%06I64u|>%I64u|ec=%.20s:%d,bytes_transferred=%I64u\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       "@asio|%llu.%06llu|>%llu|ec=%.20s:%d,bytes_transferred=%llu\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000),
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds,
       id_, ec.category().name(), ec.value(),
- static_cast<boost::uint64_t>(bytes_transferred));
+ static_cast<uint64_t>(bytes_transferred));
 
   invoked_ = true;
 }
@@ -181,18 +201,15 @@
 void handler_tracking::completion::invocation_begin(
     const boost::system::error_code& ec, int signal_number)
 {
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
   write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
       "@asio|%I64u.%06I64u|>%I64u|ec=%.20s:%d,signal_number=%d\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       "@asio|%llu.%06llu|>%llu|ec=%.20s:%d,signal_number=%d\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000),
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds,
       id_, ec.category().name(), ec.value(), signal_number);
 
   invoked_ = true;
@@ -201,18 +218,15 @@
 void handler_tracking::completion::invocation_begin(
     const boost::system::error_code& ec, const char* arg)
 {
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
   write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
       "@asio|%I64u.%06I64u|>%I64u|ec=%.20s:%d,%.50s\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       "@asio|%llu.%06llu|>%llu|ec=%.20s:%d,%.50s\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000),
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds,
       id_, ec.category().name(), ec.value(), arg);
 
   invoked_ = true;
@@ -222,18 +236,15 @@
 {
   if (id_)
   {
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
     write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
         "@asio|%I64u.%06I64u|<%I64u|\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
         "@asio|%llu.%06llu|<%llu|\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000), id_);
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds);
 
     id_ = 0;
   }
@@ -244,22 +255,19 @@
 {
   static tracking_state* state = get_state();
 
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
   unsigned long long current_id = 0;
   if (completion* current_completion = *state->current_completion_)
     current_id = current_completion->id_;
 
   write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
       "@asio|%I64u.%06I64u|%I64u|%.20s@%p.%.50s\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       "@asio|%llu.%06llu|%llu|%.20s@%p.%.50s\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000),
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds,
       current_id, object_type, object, op_name);
 }
 
@@ -271,21 +279,21 @@
   va_start(args, format);
 
   char line[256] = "";
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_HAS_SECURE_RTL)
   int length = vsprintf_s(line, sizeof(line), format, args);
-#else // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#else // defined(BOOST_ASIO_HAS_SECURE_RTL)
   int length = vsprintf(line, format, args);
-#endif // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_HAS_SECURE_RTL)
 
   va_end(args);
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
   HANDLE stderr_handle = ::GetStdHandle(STD_ERROR_HANDLE);
   DWORD bytes_written = 0;
   ::WriteFile(stderr_handle, line, length, &bytes_written, 0);
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
   ::write(STDERR_FILENO, line, length);
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 }
 
 } // namespace detail

Modified: trunk/boost/asio/detail/impl/pipe_select_interrupter.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/pipe_select_interrupter.ipp (original)
+++ trunk/boost/asio/detail/impl/pipe_select_interrupter.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS)
+#if !defined(BOOST_ASIO_WINDOWS)
 #if !defined(__CYGWIN__)
 #if !defined(__SYMBIAN32__)
 #if !defined(BOOST_ASIO_HAS_EVENTFD)
@@ -119,6 +119,6 @@
 #endif // !defined(BOOST_ASIO_HAS_EVENTFD)
 #endif // !defined(__SYMBIAN32__)
 #endif // !defined(__CYGWIN__)
-#endif // !defined(BOOST_WINDOWS)
+#endif // !defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_PIPE_SELECT_INTERRUPTER_IPP

Modified: trunk/boost/asio/detail/impl/posix_event.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/posix_event.ipp (original)
+++ trunk/boost/asio/detail/impl/posix_event.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <boost/asio/detail/posix_event.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -44,6 +44,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_POSIX_EVENT_IPP

Modified: trunk/boost/asio/detail/impl/posix_mutex.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/posix_mutex.ipp (original)
+++ trunk/boost/asio/detail/impl/posix_mutex.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <boost/asio/detail/posix_mutex.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -43,6 +43,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_POSIX_MUTEX_IPP

Modified: trunk/boost/asio/detail/impl/posix_thread.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/posix_thread.ipp (original)
+++ trunk/boost/asio/detail/impl/posix_thread.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <boost/asio/detail/posix_thread.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -71,6 +71,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_POSIX_THREAD_IPP

Modified: trunk/boost/asio/detail/impl/posix_tss_ptr.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/posix_tss_ptr.ipp (original)
+++ trunk/boost/asio/detail/impl/posix_tss_ptr.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <boost/asio/detail/posix_tss_ptr.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -43,6 +43,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_POSIX_TSS_PTR_IPP

Modified: trunk/boost/asio/detail/impl/reactive_descriptor_service.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/reactive_descriptor_service.ipp (original)
+++ trunk/boost/asio/detail/impl/reactive_descriptor_service.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <boost/asio/error.hpp>
 #include <boost/asio/detail/reactive_descriptor_service.hpp>
@@ -201,6 +201,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_REACTIVE_DESCRIPTOR_SERVICE_IPP

Modified: trunk/boost/asio/detail/impl/reactive_serial_port_service.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/reactive_serial_port_service.ipp (original)
+++ trunk/boost/asio/detail/impl/reactive_serial_port_service.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,7 +19,7 @@
 #include <boost/asio/detail/config.hpp>
 
 #if defined(BOOST_ASIO_HAS_SERIAL_PORT)
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <cstring>
 #include <boost/asio/detail/reactive_serial_port_service.hpp>
@@ -147,7 +147,7 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 #endif // defined(BOOST_ASIO_HAS_SERIAL_PORT)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_REACTIVE_SERIAL_PORT_SERVICE_IPP

Modified: trunk/boost/asio/detail/impl/select_reactor.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/select_reactor.ipp (original)
+++ trunk/boost/asio/detail/impl/select_reactor.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -186,7 +186,7 @@
       max_fd = fd_sets_[i].max_descriptor();
   }
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   // Connection operations on Windows use both except and write fd_sets.
   have_work_to_do = have_work_to_do || !op_queue_[connect_op].empty();
   op_queue_[connect_op].get_descriptors(fd_sets_[write_op], ops);
@@ -195,7 +195,7 @@
   op_queue_[connect_op].get_descriptors(fd_sets_[except_op], ops);
   if (fd_sets_[except_op].max_descriptor() > max_fd)
     max_fd = fd_sets_[except_op].max_descriptor();
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
   // We can return immediately if there's no work to do and the reactor is
   // not supposed to block.
@@ -225,13 +225,13 @@
   // Dispatch all ready operations.
   if (retval > 0)
   {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
     // Connection operations on Windows use both except and write fd_sets.
     op_queue_[connect_op].perform_operations_for_descriptors(
         fd_sets_[except_op], ops);
     op_queue_[connect_op].perform_operations_for_descriptors(
         fd_sets_[write_op], ops);
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
     // Exception operations must be processed first to ensure that any
     // out-of-band data is read before normal data.

Modified: trunk/boost/asio/detail/impl/service_registry.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/service_registry.ipp (original)
+++ trunk/boost/asio/detail/impl/service_registry.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,9 +16,9 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/throw_exception.hpp>
 #include <vector>
 #include <boost/asio/detail/service_registry.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -146,7 +146,7 @@
     boost::asio::io_service::service* new_service)
 {
   if (&owner_ != &new_service->get_io_service())
- boost::throw_exception(invalid_service_owner());
+ boost::asio::detail::throw_exception(invalid_service_owner());
 
   boost::asio::detail::mutex::scoped_lock lock(mutex_);
 
@@ -155,7 +155,7 @@
   while (service)
   {
     if (keys_match(service->key_, key))
- boost::throw_exception(service_already_exists());
+ boost::asio::detail::throw_exception(service_already_exists());
     service = service->next_;
   }
 

Modified: trunk/boost/asio/detail/impl/signal_set_service.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/signal_set_service.ipp (original)
+++ trunk/boost/asio/detail/impl/signal_set_service.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -59,23 +59,23 @@
 
 void asio_signal_handler(int signal_number)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   signal_set_service::deliver_signal(signal_number);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   int saved_errno = errno;
   signal_state* state = get_signal_state();
   signed_size_type result = ::write(state->write_descriptor_,
       &signal_number, sizeof(signal_number));
   (void)result;
   errno = saved_errno;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #if defined(BOOST_ASIO_HAS_SIGNAL) && !defined(BOOST_ASIO_HAS_SIGACTION)
   ::signal(signal_number, asio_signal_handler);
 #endif // defined(BOOST_ASIO_HAS_SIGNAL) && !defined(BOOST_ASIO_HAS_SIGACTION)
 }
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 class signal_set_service::pipe_read_op : public reactor_op
 {
 public:
@@ -105,22 +105,22 @@
     delete o;
   }
 };
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 signal_set_service::signal_set_service(
     boost::asio::io_service& io_service)
   : io_service_(boost::asio::use_service<io_service_impl>(io_service)),
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
     reactor_(boost::asio::use_service<reactor>(io_service)),
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
     next_(0),
     prev_(0)
 {
   get_signal_state()->mutex_.init();
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   reactor_.init_task();
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
   for (int i = 0; i < max_signal_number; ++i)
     registrations_[i] = 0;
@@ -155,7 +155,7 @@
 void signal_set_service::fork_service(
     boost::asio::io_service::fork_event fork_ev)
 {
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   signal_state* state = get_signal_state();
   static_mutex::scoped_lock lock(state->mutex_);
 
@@ -185,9 +185,9 @@
   default:
     break;
   }
-#else // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#else // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   (void)fork_ev;
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 }
 
 void signal_set_service::construct(
@@ -247,12 +247,12 @@
       if (::signal(signal_number, asio_signal_handler) == SIG_ERR)
 # endif // defined(BOOST_ASIO_HAS_SIGACTION)
       {
-# if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         ec = boost::asio::error::invalid_argument;
-# else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         ec = boost::system::error_code(errno,
             boost::asio::error::get_system_category());
-# endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         delete new_registration;
         return ec;
       }
@@ -317,12 +317,12 @@
       if (::signal(signal_number, SIG_DFL) == SIG_ERR)
 # endif // defined(BOOST_ASIO_HAS_SIGACTION)
       {
-# if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         ec = boost::asio::error::invalid_argument;
-# else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         ec = boost::system::error_code(errno,
             boost::asio::error::get_system_category());
-# endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         return ec;
       }
     }
@@ -371,12 +371,12 @@
       if (::signal(reg->signal_number_, SIG_DFL) == SIG_ERR)
 # endif // defined(BOOST_ASIO_HAS_SIGACTION)
       {
-# if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         ec = boost::asio::error::invalid_argument;
-# else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         ec = boost::system::error_code(errno,
             boost::asio::error::get_system_category());
-# endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         return ec;
       }
     }
@@ -466,11 +466,11 @@
   signal_state* state = get_signal_state();
   static_mutex::scoped_lock lock(state->mutex_);
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   // If this is the first service to be created, open a new pipe.
   if (state->service_list_ == 0)
     open_descriptors();
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
   // Insert service into linked list of all services.
   service->next_ = state->service_list_;
@@ -479,11 +479,11 @@
     state->service_list_->prev_ = service;
   state->service_list_ = service;
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   // Register for pipe readiness notifications.
   service->reactor_.register_internal_descriptor(reactor::read_op,
       state->read_descriptor_, service->reactor_data_, new pipe_read_op);
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 }
 
 void signal_set_service::remove_service(signal_set_service* service)
@@ -493,11 +493,11 @@
 
   if (service->next_ || service->prev_ || state->service_list_ == service)
   {
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
     // Disable the pipe readiness notifications.
     service->reactor_.deregister_descriptor(
         state->read_descriptor_, service->reactor_data_, false);
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
     // Remove service from linked list of all services.
     if (state->service_list_ == service)
@@ -509,17 +509,17 @@
     service->next_ = 0;
     service->prev_ = 0;
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
     // If this is the last service to be removed, close the pipe.
     if (state->service_list_ == 0)
       close_descriptors();
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   }
 }
 
 void signal_set_service::open_descriptors()
 {
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   signal_state* state = get_signal_state();
 
   int pipe_fds[2];
@@ -542,12 +542,12 @@
         boost::asio::error::get_system_category());
     boost::asio::detail::throw_error(ec, "signal_set_service pipe");
   }
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 }
 
 void signal_set_service::close_descriptors()
 {
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   signal_state* state = get_signal_state();
 
   if (state->read_descriptor_ != -1)
@@ -557,7 +557,7 @@
   if (state->write_descriptor_ != -1)
     ::close(state->write_descriptor_);
   state->write_descriptor_ = -1;
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 }
 
 void signal_set_service::start_wait_op(

Modified: trunk/boost/asio/detail/impl/socket_ops.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/socket_ops.ipp (original)
+++ trunk/boost/asio/detail/impl/socket_ops.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,17 +16,24 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/assert.hpp>
-#include <boost/detail/workaround.hpp>
 #include <cctype>
 #include <cstdio>
 #include <cstdlib>
 #include <cstring>
 #include <cerrno>
 #include <new>
+#include <boost/asio/detail/assert.hpp>
 #include <boost/asio/detail/socket_ops.hpp>
 #include <boost/asio/error.hpp>
 
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) \
+ || defined(__MACH__) && defined(__APPLE__)
+# if defined(BOOST_ASIO_HAS_PTHREADS)
+# include <pthread.h>
+# endif // defined(BOOST_ASIO_HAS_PTHREADS)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
+ // || defined(__MACH__) && defined(__APPLE__)
+
 #include <boost/asio/detail/push_options.hpp>
 
 namespace boost {
@@ -34,9 +41,9 @@
 namespace detail {
 namespace socket_ops {
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 struct msghdr { int msg_namelen; };
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #if defined(__hpux)
 // HP-UX doesn't declare these functions extern "C", so they are declared again
@@ -47,7 +54,7 @@
 
 inline void clear_last_error()
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   WSASetLastError(0);
 #else
   errno = 0;
@@ -58,7 +65,7 @@
 inline ReturnType error_wrapper(ReturnType return_value,
     boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   ec = boost::system::error_code(WSAGetLastError(),
       boost::asio::error::get_system_category());
 #else
@@ -293,11 +300,11 @@
     }
 
     clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
     result = error_wrapper(::closesocket(s), ec);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
     result = error_wrapper(::close(s), ec);
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
     if (result != 0
         && (ec == boost::asio::error::would_block
@@ -309,10 +316,10 @@
       // current OS where this behaviour is seen, Windows, says that the socket
       // remains open. Therefore we'll put the descriptor back into blocking
       // mode and have another attempt at closing it.
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
       ioctl_arg_type arg = 0;
       ::ioctlsocket(s, FIONBIO, &arg);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if defined(__SYMBIAN32__)
       int flags = ::fcntl(s, F_GETFL, 0);
       if (flags >= 0)
@@ -321,15 +328,15 @@
       ioctl_arg_type arg = 0;
       ::ioctl(s, FIONBIO, &arg);
 # endif // defined(__SYMBIAN32__)
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
       state &= ~non_blocking;
 
       clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
       result = error_wrapper(::closesocket(s), ec);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
       result = error_wrapper(::close(s), ec);
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
     }
   }
 
@@ -348,7 +355,7 @@
   }
 
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   ioctl_arg_type arg = (value ? 1 : 0);
   int result = error_wrapper(::ioctlsocket(s, FIONBIO, &arg), ec);
 #elif defined(__SYMBIAN32__)
@@ -401,7 +408,7 @@
   }
 
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   ioctl_arg_type arg = (value ? 1 : 0);
   int result = error_wrapper(::ioctlsocket(s, FIONBIO, &arg), ec);
 #elif defined(__SYMBIAN32__)
@@ -524,7 +531,7 @@
 int socketpair(int af, int type, int protocol,
     socket_type sv[2], boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   (void)(af);
   (void)(type);
   (void)(protocol);
@@ -550,11 +557,11 @@
 
 #if defined(SIOCATMARK)
   ioctl_arg_type value = 0;
-# if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   int result = error_wrapper(::ioctlsocket(s, SIOCATMARK, &value), ec);
-# else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   int result = error_wrapper(::ioctl(s, SIOCATMARK, &value), ec);
-# endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   if (result == 0)
     ec = boost::system::error_code();
 # if defined(ENOTTY)
@@ -579,11 +586,11 @@
   }
 
   ioctl_arg_type value = 0;
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   int result = error_wrapper(::ioctlsocket(s, FIONREAD, &value), ec);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   int result = error_wrapper(::ioctl(s, FIONREAD, &value), ec);
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   if (result == 0)
     ec = boost::system::error_code();
 #if defined(ENOTTY)
@@ -620,32 +627,32 @@
   base = static_cast<T>(addr);
 }
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 typedef WSABUF buf;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 typedef iovec buf;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 void init_buf(buf& b, void* data, size_t size)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   b.buf = static_cast<char*>(data);
   b.len = static_cast<u_long>(size);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   init_buf_iov_base(b.iov_base, data);
   b.iov_len = size;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 void init_buf(buf& b, const void* data, size_t size)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   b.buf = static_cast<char*>(const_cast<void*>(data));
   b.len = static_cast<u_long>(size);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   init_buf_iov_base(b.iov_base, const_cast<void*>(data));
   b.iov_len = size;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 inline void init_msghdr_msg_name(void*& name, socket_addr_type* addr)
@@ -674,7 +681,7 @@
     int flags, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   // Receive some data.
   DWORD recv_buf_count = static_cast<DWORD>(count);
   DWORD bytes_transferred = 0;
@@ -689,7 +696,7 @@
     return socket_error_retval;
   ec = boost::system::error_code();
   return bytes_transferred;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   msghdr msg = msghdr();
   msg.msg_iov = bufs;
   msg.msg_iovlen = static_cast<int>(count);
@@ -697,7 +704,7 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 size_t sync_recv(socket_type s, state_type state, buf* bufs,
@@ -820,7 +827,7 @@
     boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   // Receive some data.
   DWORD recv_buf_count = static_cast<DWORD>(count);
   DWORD bytes_transferred = 0;
@@ -837,7 +844,7 @@
     return socket_error_retval;
   ec = boost::system::error_code();
   return bytes_transferred;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   msghdr msg = msghdr();
   init_msghdr_msg_name(msg.msg_name, addr);
   msg.msg_namelen = static_cast<int>(*addrlen);
@@ -848,7 +855,7 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 size_t sync_recvfrom(socket_type s, state_type state, buf* bufs,
@@ -945,10 +952,10 @@
     int in_flags, int& out_flags, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   out_flags = 0;
   return socket_ops::recv(s, bufs, count, in_flags, ec);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   msghdr msg = msghdr();
   msg.msg_iov = bufs;
   msg.msg_iovlen = static_cast<int>(count);
@@ -961,7 +968,7 @@
   else
     out_flags = 0;
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 size_t sync_recvmsg(socket_type s, state_type state,
@@ -1057,7 +1064,7 @@
     int flags, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   // Send the data.
   DWORD send_buf_count = static_cast<DWORD>(count);
   DWORD bytes_transferred = 0;
@@ -1072,7 +1079,7 @@
     return socket_error_retval;
   ec = boost::system::error_code();
   return bytes_transferred;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   msghdr msg = msghdr();
   msg.msg_iov = const_cast<buf*>(bufs);
   msg.msg_iovlen = static_cast<int>(count);
@@ -1083,7 +1090,7 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 size_t sync_send(socket_type s, state_type state, const buf* bufs,
@@ -1184,7 +1191,7 @@
     boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   // Send the data.
   DWORD send_buf_count = static_cast<DWORD>(count);
   DWORD bytes_transferred = 0;
@@ -1199,7 +1206,7 @@
     return socket_error_retval;
   ec = boost::system::error_code();
   return bytes_transferred;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   msghdr msg = msghdr();
   init_msghdr_msg_name(msg.msg_name, addr);
   msg.msg_namelen = static_cast<int>(addrlen);
@@ -1212,7 +1219,7 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 size_t sync_sendto(socket_type s, state_type state, const buf* bufs,
@@ -1289,7 +1296,7 @@
     boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   socket_type s = error_wrapper(::WSASocket(af, type, protocol, 0, 0,
         WSA_FLAG_OVERLAPPED), ec);
   if (s == invalid_socket)
@@ -1487,7 +1494,7 @@
   }
   ec = boost::asio::error::fault;
   return socket_error_retval;
-#elif defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#elif defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   clear_last_error();
   int result = error_wrapper(call_getsockopt(&msghdr::msg_namelen,
         s, level, optname, optval, optlen), ec);
@@ -1505,7 +1512,7 @@
   if (result == 0)
     ec = boost::system::error_code();
   return result;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   clear_last_error();
   int result = error_wrapper(call_getsockopt(&msghdr::msg_namelen,
         s, level, optname, optval, optlen), ec);
@@ -1524,7 +1531,7 @@
   if (result == 0)
     ec = boost::system::error_code();
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 template <typename SockLenType>
@@ -1546,7 +1553,7 @@
     return socket_error_retval;
   }
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   if (cached)
   {
     // Check if socket is still connected.
@@ -1567,9 +1574,9 @@
     ec = boost::system::error_code();
     return 0;
   }
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   (void)cached;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
   clear_last_error();
   int result = error_wrapper(call_getpeername(
@@ -1616,7 +1623,7 @@
   }
 
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   int result = error_wrapper(::ioctlsocket(s, cmd, arg), ec);
 #elif defined(__MACH__) && defined(__APPLE__) \
   || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
@@ -1657,7 +1664,7 @@
     fd_set* exceptfds, timeval* timeout, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   if (!readfds && !writefds && !exceptfds && timeout)
   {
     DWORD milliseconds = timeout->tv_sec * 1000 + timeout->tv_usec / 1000;
@@ -1677,7 +1684,7 @@
   if (timeout && timeout->tv_sec == 0
       && timeout->tv_usec > 0 && timeout->tv_usec < 1000)
     timeout->tv_usec = 1000;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #if defined(__hpux) && defined(__SELECT)
   timespec ts;
@@ -1702,7 +1709,7 @@
     return socket_error_retval;
   }
 
-#if defined(BOOST_WINDOWS) \
+#if defined(BOOST_ASIO_WINDOWS) \
   || defined(__CYGWIN__) \
   || defined(__SYMBIAN32__)
   fd_set fds;
@@ -1714,7 +1721,7 @@
   timeval* timeout = (state & user_set_non_blocking) ? &zero_timeout : 0;
   clear_last_error();
   int result = error_wrapper(::select(s, &fds, 0, 0, timeout), ec);
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       // || defined(__CYGWIN__)
       // || defined(__SYMBIAN32__)
   pollfd fds;
@@ -1724,7 +1731,7 @@
   int timeout = (state & user_set_non_blocking) ? 0 : -1;
   clear_last_error();
   int result = error_wrapper(::poll(&fds, 1, timeout), ec);
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
        // || defined(__CYGWIN__)
        // || defined(__SYMBIAN32__)
   if (result == 0)
@@ -1743,7 +1750,7 @@
     return socket_error_retval;
   }
 
-#if defined(BOOST_WINDOWS) \
+#if defined(BOOST_ASIO_WINDOWS) \
   || defined(__CYGWIN__) \
   || defined(__SYMBIAN32__)
   fd_set fds;
@@ -1755,7 +1762,7 @@
   timeval* timeout = (state & user_set_non_blocking) ? &zero_timeout : 0;
   clear_last_error();
   int result = error_wrapper(::select(s, 0, &fds, 0, timeout), ec);
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       // || defined(__CYGWIN__)
       // || defined(__SYMBIAN32__)
   pollfd fds;
@@ -1765,7 +1772,7 @@
   int timeout = (state & user_set_non_blocking) ? 0 : -1;
   clear_last_error();
   int result = error_wrapper(::poll(&fds, 1, timeout), ec);
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
        // || defined(__CYGWIN__)
        // || defined(__SYMBIAN32__)
   if (result == 0)
@@ -1784,7 +1791,7 @@
     return socket_error_retval;
   }
 
-#if defined(BOOST_WINDOWS) \
+#if defined(BOOST_ASIO_WINDOWS) \
   || defined(__CYGWIN__) \
   || defined(__SYMBIAN32__)
   fd_set write_fds;
@@ -1798,7 +1805,7 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       // || defined(__CYGWIN__)
       // || defined(__SYMBIAN32__)
   pollfd fds;
@@ -1810,7 +1817,7 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
        // || defined(__CYGWIN__)
        // || defined(__SYMBIAN32__)
 }
@@ -1819,7 +1826,7 @@
     unsigned long scope_id, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   using namespace std; // For memcpy.
 
   if (af != AF_INET && af != AF_INET6)
@@ -1873,7 +1880,7 @@
     ec = boost::asio::error::invalid_argument;
 
   return result == socket_error_retval ? 0 : dest;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   const char* result = error_wrapper(::inet_ntop(
         af, src, dest, static_cast<int>(length)), ec);
   if (result == 0 && !ec)
@@ -1891,14 +1898,14 @@
     strcat(dest, if_name);
   }
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 int inet_pton(int af, const char* src, void* dest,
     unsigned long* scope_id, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   using namespace std; // For memcpy and strcmp.
 
   if (af != AF_INET && af != AF_INET6)
@@ -1958,7 +1965,7 @@
     ec = boost::system::error_code();
 
   return result == socket_error_retval ? -1 : 1;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   int result = error_wrapper(::inet_pton(af, src, dest), ec);
   if (result <= 0 && !ec)
     ec = boost::asio::error::invalid_argument;
@@ -1978,21 +1985,21 @@
     }
   }
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 int gethostname(char* name, int namelen, boost::system::error_code& ec)
 {
   clear_last_error();
   int result = error_wrapper(::gethostname(name, namelen), ec);
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
   if (result == 0)
     ec = boost::system::error_code();
 #endif
   return result;
 }
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) \
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) \
   || defined(__MACH__) && defined(__APPLE__)
 
 // The following functions are only needed for emulation of getaddrinfo and
@@ -2013,7 +2020,7 @@
   case NO_DATA:
     return boost::asio::error::no_data;
   default:
- BOOST_ASSERT(false);
+ BOOST_ASIO_ASSERT(false);
     return boost::asio::error::invalid_argument;
   }
 }
@@ -2022,7 +2029,7 @@
     hostent* result, char* buffer, int buflength, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   (void)(buffer);
   (void)(buflength);
   hostent* retval = error_wrapper(::gethostbyaddr(addr, length, af), ec);
@@ -2065,7 +2072,7 @@
     char* buffer, int buflength, int ai_flags, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   (void)(buffer);
   (void)(buflength);
   (void)(ai_flags);
@@ -2250,12 +2257,12 @@
 inline void gai_strcpy(char* target, const char* source, std::size_t max_size)
 {
   using namespace std;
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_HAS_SECURE_RTL)
   strcpy_s(target, max_size, source);
-#else
+#else // defined(BOOST_ASIO_HAS_SECURE_RTL)
   *target = 0;
   strncat(target, source, max_size);
-#endif
+#endif // defined(BOOST_ASIO_HAS_SECURE_RTL)
 }
 
 enum { gai_clone_flag = 1 << 30 };
@@ -2789,20 +2796,18 @@
       {
         return ec = boost::asio::error::no_buffer_space;
       }
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_HAS_SECURE_RTL)
       sprintf_s(serv, servlen, "%u", ntohs(port));
-#else
+#else // defined(BOOST_ASIO_HAS_SECURE_RTL)
       sprintf(serv, "%u", ntohs(port));
-#endif
+#endif // defined(BOOST_ASIO_HAS_SECURE_RTL)
     }
     else
     {
-#if defined(BOOST_HAS_THREADS) && defined(BOOST_HAS_PTHREADS) \
- && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
       static ::pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
       ::pthread_mutex_lock(&mutex);
-#endif // defined(BOOST_HAS_THREADS) && defined(BOOST_HAS_PTHREADS)
- // && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
       servent* sptr = ::getservbyport(port, (flags & NI_DGRAM) ? "udp" : 0);
       if (sptr && sptr->s_name && sptr->s_name[0] != '\0')
       {
@@ -2814,17 +2819,15 @@
         {
           return ec = boost::asio::error::no_buffer_space;
         }
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_HAS_SECURE_RTL)
         sprintf_s(serv, servlen, "%u", ntohs(port));
-#else
+#else // defined(BOOST_ASIO_HAS_SECURE_RTL)
         sprintf(serv, "%u", ntohs(port));
-#endif
+#endif // defined(BOOST_ASIO_HAS_SECURE_RTL)
       }
-#if defined(BOOST_HAS_THREADS) && defined(BOOST_HAS_PTHREADS) \
- && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
       ::pthread_mutex_unlock(&mutex);
-#endif // defined(BOOST_HAS_THREADS) && defined(BOOST_HAS_PTHREADS)
- // && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
     }
   }
 
@@ -2832,7 +2835,7 @@
   return ec;
 }
 
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
        // || defined(__MACH__) && defined(__APPLE__)
 
 inline boost::system::error_code translate_addrinfo_error(int error)
@@ -2864,7 +2867,7 @@
   case EAI_SOCKTYPE:
     return boost::asio::error::socket_type_not_supported;
   default: // Possibly the non-portable EAI_SYSTEM.
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
     return boost::system::error_code(
         WSAGetLastError(), boost::asio::error::get_system_category());
 #else
@@ -2881,7 +2884,7 @@
   host = (host && *host) ? host : 0;
   service = (service && *service) ? service : 0;
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) || defined(UNDER_CE)
   // Building for Windows XP, Windows Server 2003, or later.
   int error = ::getaddrinfo(host, service, &hints, result);
@@ -2924,7 +2927,7 @@
 
 void freeaddrinfo(addrinfo_type* ai)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) || defined(UNDER_CE)
   // Building for Windows XP, Windows Server 2003, or later.
   ::freeaddrinfo(ai);
@@ -2952,7 +2955,7 @@
     std::size_t addrlen, char* host, std::size_t hostlen,
     char* serv, std::size_t servlen, int flags, boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) || defined(UNDER_CE)
   // Building for Windows XP, Windows Server 2003, or later.
   clear_last_error();

Modified: trunk/boost/asio/detail/impl/socket_select_interrupter.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/socket_select_interrupter.ipp (original)
+++ trunk/boost/asio/detail/impl/socket_select_interrupter.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) \
+#if defined(BOOST_ASIO_WINDOWS) \
   || defined(__CYGWIN__) \
   || defined(__SYMBIAN32__)
 
@@ -166,7 +166,7 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
        // || defined(__CYGWIN__)
        // || defined(__SYMBIAN32__)
 

Modified: trunk/boost/asio/detail/impl/strand_service.hpp
==============================================================================
--- trunk/boost/asio/detail/impl/strand_service.hpp (original)
+++ trunk/boost/asio/detail/impl/strand_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -15,6 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/call_stack.hpp>
 #include <boost/asio/detail/completion_handler.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -64,7 +65,7 @@
 
   // Allocate and construct an operation to wrap the handler.
   typedef completion_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
     boost_asio_handler_alloc_helpers::allocate(
       sizeof(op), handler), 0 };
   p.p = new (p.v) op(handler);
@@ -99,7 +100,7 @@
 
   // Allocate and construct an operation to wrap the handler.
   typedef completion_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
     boost_asio_handler_alloc_helpers::allocate(
       sizeof(op), handler), 0 };
   p.p = new (p.v) op(handler);

Modified: trunk/boost/asio/detail/impl/task_io_service.hpp
==============================================================================
--- trunk/boost/asio/detail/impl/task_io_service.hpp (original)
+++ trunk/boost/asio/detail/impl/task_io_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -15,6 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/completion_handler.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
@@ -39,7 +40,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef completion_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -59,7 +60,7 @@
 
   // Allocate and construct an operation to wrap the handler.
   typedef completion_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
     boost_asio_handler_alloc_helpers::allocate(
       sizeof(op), handler), 0 };
   p.p = new (p.v) op(handler);

Modified: trunk/boost/asio/detail/impl/task_io_service.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/task_io_service.ipp (original)
+++ trunk/boost/asio/detail/impl/task_io_service.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,8 +19,8 @@
 
 #if !defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/limits.hpp>
 #include <boost/asio/detail/event.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/reactor.hpp>
 #include <boost/asio/detail/task_io_service.hpp>
 #include <boost/asio/detail/task_io_service_thread_info.hpp>
@@ -72,13 +72,13 @@
     }
     this_thread_->private_outstanding_work = 0;
 
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_THREADS)
     if (!this_thread_->private_op_queue.empty())
     {
       lock_->lock();
       task_io_service_->op_queue_.push(this_thread_->private_op_queue);
     }
-#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_THREADS)
   }
 
   task_io_service* task_io_service_;
@@ -194,14 +194,14 @@
 
   mutex::scoped_lock lock(mutex_);
 
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_THREADS)
   // We want to support nested calls to poll() and poll_one(), so any handlers
   // that are already on a thread-private queue need to be put on to the main
   // queue now.
   if (one_thread_)
     if (thread_info* outer_thread_info = ctx.next_by_key())
       op_queue_.push(outer_thread_info->private_op_queue);
-#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_THREADS)
 
   std::size_t n = 0;
   for (; do_poll_one(lock, this_thread, ec); lock.lock())
@@ -227,14 +227,14 @@
 
   mutex::scoped_lock lock(mutex_);
 
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_THREADS)
   // We want to support nested calls to poll() and poll_one(), so any handlers
   // that are already on a thread-private queue need to be put on to the main
   // queue now.
   if (one_thread_)
     if (thread_info* outer_thread_info = ctx.next_by_key())
       op_queue_.push(outer_thread_info->private_op_queue);
-#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_THREADS)
 
   return do_poll_one(lock, this_thread, ec);
 }
@@ -260,7 +260,7 @@
 void task_io_service::post_immediate_completion(
     task_io_service::operation* op, bool is_continuation)
 {
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_THREADS)
   if (one_thread_ || is_continuation)
   {
     if (thread_info* this_thread = thread_call_stack::contains(this))
@@ -270,7 +270,7 @@
       return;
     }
   }
-#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_THREADS)
 
   work_started();
   mutex::scoped_lock lock(mutex_);
@@ -280,7 +280,7 @@
 
 void task_io_service::post_deferred_completion(task_io_service::operation* op)
 {
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_THREADS)
   if (one_thread_)
   {
     if (thread_info* this_thread = thread_call_stack::contains(this))
@@ -289,7 +289,7 @@
       return;
     }
   }
-#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_THREADS)
 
   mutex::scoped_lock lock(mutex_);
   op_queue_.push(op);
@@ -301,7 +301,7 @@
 {
   if (!ops.empty())
   {
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_THREADS)
     if (one_thread_)
     {
       if (thread_info* this_thread = thread_call_stack::contains(this))
@@ -310,7 +310,7 @@
         return;
       }
     }
-#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_THREADS)
 
     mutex::scoped_lock lock(mutex_);
     op_queue_.push(ops);

Modified: trunk/boost/asio/detail/impl/throw_error.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/throw_error.ipp (original)
+++ trunk/boost/asio/detail/impl/throw_error.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,8 +16,8 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 #include <boost/system/system_error.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -29,13 +29,13 @@
 void do_throw_error(const boost::system::error_code& err)
 {
   boost::system::system_error e(err);
- boost::throw_exception(e);
+ boost::asio::detail::throw_exception(e);
 }
 
 void do_throw_error(const boost::system::error_code& err, const char* location)
 {
   boost::system::system_error e(err, location);
- boost::throw_exception(e);
+ boost::asio::detail::throw_exception(e);
 }
 
 } // namespace detail

Modified: trunk/boost/asio/detail/impl/timer_queue_ptime.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/timer_queue_ptime.ipp (original)
+++ trunk/boost/asio/detail/impl/timer_queue_ptime.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -20,6 +20,8 @@
 
 #include <boost/asio/detail/push_options.hpp>
 
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
 namespace boost {
 namespace asio {
 namespace detail {
@@ -77,6 +79,8 @@
 } // namespace asio
 } // namespace boost
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
 #include <boost/asio/detail/pop_options.hpp>
 
 #endif // BOOST_ASIO_DETAIL_IMPL_TIMER_QUEUE_PTIME_IPP

Modified: trunk/boost/asio/detail/impl/win_event.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/win_event.ipp (original)
+++ trunk/boost/asio/detail/impl/win_event.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/detail/win_event.hpp>
@@ -47,6 +47,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_WIN_EVENT_IPP

Modified: trunk/boost/asio/detail/impl/win_iocp_handle_service.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/win_iocp_handle_service.ipp (original)
+++ trunk/boost/asio/detail/impl/win_iocp_handle_service.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -293,7 +293,7 @@
 }
 
 size_t win_iocp_handle_service::do_write(
- win_iocp_handle_service::implementation_type& impl, boost::uint64_t offset,
+ win_iocp_handle_service::implementation_type& impl, uint64_t offset,
     const boost::asio::const_buffer& buffer, boost::system::error_code& ec)
 {
   if (!is_open(impl))
@@ -349,7 +349,7 @@
 }
 
 void win_iocp_handle_service::start_write_op(
- win_iocp_handle_service::implementation_type& impl, boost::uint64_t offset,
+ win_iocp_handle_service::implementation_type& impl, uint64_t offset,
     const boost::asio::const_buffer& buffer, operation* op)
 {
   update_cancellation_thread_id(impl);
@@ -387,7 +387,7 @@
 }
 
 size_t win_iocp_handle_service::do_read(
- win_iocp_handle_service::implementation_type& impl, boost::uint64_t offset,
+ win_iocp_handle_service::implementation_type& impl, uint64_t offset,
     const boost::asio::mutable_buffer& buffer, boost::system::error_code& ec)
 {
   if (!is_open(impl))
@@ -457,7 +457,7 @@
 }
 
 void win_iocp_handle_service::start_read_op(
- win_iocp_handle_service::implementation_type& impl, boost::uint64_t offset,
+ win_iocp_handle_service::implementation_type& impl, uint64_t offset,
     const boost::asio::mutable_buffer& buffer, operation* op)
 {
   update_cancellation_thread_id(impl);

Modified: trunk/boost/asio/detail/impl/win_iocp_io_service.hpp
==============================================================================
--- trunk/boost/asio/detail/impl/win_iocp_io_service.hpp (original)
+++ trunk/boost/asio/detail/impl/win_iocp_io_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,6 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/completion_handler.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
@@ -42,7 +43,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef completion_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -59,7 +60,7 @@
 {
   // Allocate and construct an operation to wrap the handler.
   typedef completion_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
     boost_asio_handler_alloc_helpers::allocate(
       sizeof(op), handler), 0 };
   p.p = new (p.v) op(handler);

Modified: trunk/boost/asio/detail/impl/win_iocp_io_service.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/win_iocp_io_service.ipp (original)
+++ trunk/boost/asio/detail/impl/win_iocp_io_service.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,11 +19,11 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/limits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/detail/win_iocp_io_service.hpp>
 

Modified: trunk/boost/asio/detail/impl/win_mutex.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/win_mutex.ipp (original)
+++ trunk/boost/asio/detail/impl/win_mutex.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/detail/win_mutex.hpp>
@@ -75,6 +75,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_WIN_MUTEX_IPP

Modified: trunk/boost/asio/detail/impl/win_static_mutex.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/win_static_mutex.ipp (original)
+++ trunk/boost/asio/detail/impl/win_static_mutex.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 #include <cstdio>
 #include <boost/asio/detail/throw_error.hpp>
@@ -42,11 +42,11 @@
 {
   using namespace std; // For sprintf.
   wchar_t mutex_name[128];
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_HAS_SECURE_RTL)
   swprintf_s(
-#else // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#else // defined(BOOST_ASIO_HAS_SECURE_RTL)
   _snwprintf(
-#endif // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_HAS_SECURE_RTL)
       mutex_name, 128, L"asio-58CCDC44-6264-4842-90C2-F3C545CB8AA7-%u-%p",
       static_cast<unsigned int>(::GetCurrentProcessId()), this);
 
@@ -115,6 +115,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_WIN_STATIC_MUTEX_IPP

Modified: trunk/boost/asio/detail/impl/win_thread.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/win_thread.ipp (original)
+++ trunk/boost/asio/detail/impl/win_thread.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 
 #include <process.h>
 #include <boost/asio/detail/throw_error.hpp>
@@ -136,6 +136,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_WIN_THREAD_IPP

Modified: trunk/boost/asio/detail/impl/win_tss_ptr.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/win_tss_ptr.ipp (original)
+++ trunk/boost/asio/detail/impl/win_tss_ptr.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/detail/win_tss_ptr.hpp>
@@ -54,6 +54,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_WIN_TSS_PTR_IPP

Modified: trunk/boost/asio/detail/impl/winsock_init.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/winsock_init.ipp (original)
+++ trunk/boost/asio/detail/impl/winsock_init.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #include <boost/asio/detail/socket_types.hpp>
 #include <boost/asio/detail/winsock_init.hpp>
@@ -66,6 +66,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_WINSOCK_INIT_IPP

Modified: trunk/boost/asio/detail/io_control.hpp
==============================================================================
--- trunk/boost/asio/detail/io_control.hpp (original)
+++ trunk/boost/asio/detail/io_control.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,6 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
-#include <boost/config.hpp>
 #include <boost/asio/detail/socket_types.hpp>
 
 #include <boost/asio/detail/push_options.hpp>

Modified: trunk/boost/asio/detail/kqueue_reactor.hpp
==============================================================================
--- trunk/boost/asio/detail/kqueue_reactor.hpp (original)
+++ trunk/boost/asio/detail/kqueue_reactor.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -20,12 +20,12 @@
 
 #if defined(BOOST_ASIO_HAS_KQUEUE)
 
-#include <boost/limits.hpp>
 #include <cstddef>
 #include <sys/types.h>
 #include <sys/event.h>
 #include <sys/time.h>
 #include <boost/asio/detail/kqueue_reactor_fwd.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/mutex.hpp>
 #include <boost/asio/detail/object_pool.hpp>
 #include <boost/asio/detail/op_queue.hpp>

Added: trunk/boost/asio/detail/limits.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/detail/limits.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -0,0 +1,26 @@
+//
+// detail/limits.hpp
+// ~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_LIMITS_HPP
+#define BOOST_ASIO_DETAIL_LIMITS_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_LIMITS)
+# include <boost/limits.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_LIMITS)
+# include <limits>
+#endif // defined(BOOST_ASIO_HAS_BOOST_LIMITS)
+
+#endif // BOOST_ASIO_DETAIL_LIMITS_HPP

Modified: trunk/boost/asio/detail/local_free_on_block_exit.hpp
==============================================================================
--- trunk/boost/asio/detail/local_free_on_block_exit.hpp (original)
+++ trunk/boost/asio/detail/local_free_on_block_exit.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/socket_types.hpp>
@@ -54,6 +54,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP

Modified: trunk/boost/asio/detail/mutex.hpp
==============================================================================
--- trunk/boost/asio/detail/mutex.hpp (original)
+++ trunk/boost/asio/detail/mutex.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,11 +17,11 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 # include <boost/asio/detail/null_mutex.hpp>
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 # include <boost/asio/detail/win_mutex.hpp>
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 # include <boost/asio/detail/posix_mutex.hpp>
 #else
 # error Only Windows and POSIX are supported!
@@ -31,11 +31,11 @@
 namespace asio {
 namespace detail {
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 typedef null_mutex mutex;
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 typedef win_mutex mutex;
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 typedef posix_mutex mutex;
 #endif
 

Modified: trunk/boost/asio/detail/noncopyable.hpp
==============================================================================
--- trunk/boost/asio/detail/noncopyable.hpp (original)
+++ trunk/boost/asio/detail/noncopyable.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,8 +16,6 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/noncopyable.hpp>
-#include <boost/detail/workaround.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -25,10 +23,6 @@
 namespace asio {
 namespace detail {
 
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-// Redefine the noncopyable class for Borland C++ since that compiler does not
-// apply the empty base optimisation unless the base class contains a dummy
-// char data member.
 class noncopyable
 {
 protected:
@@ -37,11 +31,7 @@
 private:
   noncopyable(const noncopyable&);
   const noncopyable& operator=(const noncopyable&);
- char dummy_;
 };
-#else
-using boost::noncopyable;
-#endif
 
 } // namespace detail
 

Modified: trunk/boost/asio/detail/null_event.hpp
==============================================================================
--- trunk/boost/asio/detail/null_event.hpp (original)
+++ trunk/boost/asio/detail/null_event.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 
 #include <boost/asio/detail/noncopyable.hpp>
 
@@ -72,6 +72,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // !defined(BOOST_ASIO_HAS_THREADS)
 
 #endif // BOOST_ASIO_DETAIL_NULL_EVENT_HPP

Modified: trunk/boost/asio/detail/null_mutex.hpp
==============================================================================
--- trunk/boost/asio/detail/null_mutex.hpp (original)
+++ trunk/boost/asio/detail/null_mutex.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/scoped_lock.hpp>
@@ -61,6 +61,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // !defined(BOOST_ASIO_HAS_THREADS)
 
 #endif // BOOST_ASIO_DETAIL_NULL_MUTEX_HPP

Modified: trunk/boost/asio/detail/null_signal_blocker.hpp
==============================================================================
--- trunk/boost/asio/detail/null_signal_blocker.hpp (original)
+++ trunk/boost/asio/detail/null_signal_blocker.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,9 +17,8 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) \
- || defined(BOOST_ASIO_DISABLE_THREADS) \
- || defined(BOOST_WINDOWS) \
+#if !defined(BOOST_ASIO_HAS_THREADS) \
+ || defined(BOOST_ASIO_WINDOWS) \
   || defined(__CYGWIN__) \
   || defined(__SYMBIAN32__)
 
@@ -62,9 +61,8 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_HAS_THREADS)
- // || defined(BOOST_ASIO_DISABLE_THREADS)
- // || defined(BOOST_WINDOWS)
+#endif // !defined(BOOST_ASIO_HAS_THREADS)
+ // || defined(BOOST_ASIO_WINDOWS)
        // || defined(__CYGWIN__)
        // || defined(__SYMBIAN32__)
 

Modified: trunk/boost/asio/detail/null_static_mutex.hpp
==============================================================================
--- trunk/boost/asio/detail/null_static_mutex.hpp (original)
+++ trunk/boost/asio/detail/null_static_mutex.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 
 #include <boost/asio/detail/scoped_lock.hpp>
 
@@ -57,6 +57,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // !defined(BOOST_ASIO_HAS_THREADS)
 
 #endif // BOOST_ASIO_DETAIL_NULL_STATIC_MUTEX_HPP

Modified: trunk/boost/asio/detail/null_thread.hpp
==============================================================================
--- trunk/boost/asio/detail/null_thread.hpp (original)
+++ trunk/boost/asio/detail/null_thread.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -58,6 +58,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // !defined(BOOST_ASIO_HAS_THREADS)
 
 #endif // BOOST_ASIO_DETAIL_NULL_THREAD_HPP

Modified: trunk/boost/asio/detail/null_tss_ptr.hpp
==============================================================================
--- trunk/boost/asio/detail/null_tss_ptr.hpp (original)
+++ trunk/boost/asio/detail/null_tss_ptr.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 
 #include <boost/asio/detail/noncopyable.hpp>
 
@@ -65,6 +65,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // !defined(BOOST_ASIO_HAS_THREADS)
 
 #endif // BOOST_ASIO_DETAIL_NULL_TSS_PTR_HPP

Modified: trunk/boost/asio/detail/old_win_sdk_compat.hpp
==============================================================================
--- trunk/boost/asio/detail/old_win_sdk_compat.hpp (original)
+++ trunk/boost/asio/detail/old_win_sdk_compat.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 // Guess whether we are building against on old Platform SDK.
 #if !defined(IN6ADDR_ANY_INIT)
@@ -211,6 +211,6 @@
 # define IPPROTO_ICMPV6 58
 #endif
 
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_OLD_WIN_SDK_COMPAT_HPP

Modified: trunk/boost/asio/detail/pipe_select_interrupter.hpp
==============================================================================
--- trunk/boost/asio/detail/pipe_select_interrupter.hpp (original)
+++ trunk/boost/asio/detail/pipe_select_interrupter.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS)
+#if !defined(BOOST_ASIO_WINDOWS)
 #if !defined(__CYGWIN__)
 #if !defined(__SYMBIAN32__)
 #if !defined(BOOST_ASIO_HAS_EVENTFD)
@@ -84,6 +84,6 @@
 #endif // !defined(BOOST_ASIO_HAS_EVENTFD)
 #endif // !defined(__SYMBIAN32__)
 #endif // !defined(__CYGWIN__)
-#endif // !defined(BOOST_WINDOWS)
+#endif // !defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_PIPE_SELECT_INTERRUPTER_HPP

Modified: trunk/boost/asio/detail/posix_event.hpp
==============================================================================
--- trunk/boost/asio/detail/posix_event.hpp (original)
+++ trunk/boost/asio/detail/posix_event.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,10 +17,10 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
-#include <boost/assert.hpp>
 #include <pthread.h>
+#include <boost/asio/detail/assert.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -46,7 +46,7 @@
   template <typename Lock>
   void signal(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     (void)lock;
     signalled_ = true;
     ::pthread_cond_signal(&cond_); // Ignore EINVAL.
@@ -56,7 +56,7 @@
   template <typename Lock>
   void signal_and_unlock(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     signalled_ = true;
     lock.unlock();
     ::pthread_cond_signal(&cond_); // Ignore EINVAL.
@@ -66,7 +66,7 @@
   template <typename Lock>
   void clear(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     (void)lock;
     signalled_ = false;
   }
@@ -75,7 +75,7 @@
   template <typename Lock>
   void wait(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     while (!signalled_)
       ::pthread_cond_wait(&cond_, &lock.mutex().mutex_); // Ignore EINVAL.
   }
@@ -95,6 +95,6 @@
 # include <boost/asio/detail/impl/posix_event.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_POSIX_EVENT_HPP

Modified: trunk/boost/asio/detail/posix_fd_set_adapter.hpp
==============================================================================
--- trunk/boost/asio/detail/posix_fd_set_adapter.hpp (original)
+++ trunk/boost/asio/detail/posix_fd_set_adapter.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <cstring>
 #include <boost/asio/detail/noncopyable.hpp>
@@ -84,6 +84,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_POSIX_FD_SET_ADAPTER_HPP

Modified: trunk/boost/asio/detail/posix_mutex.hpp
==============================================================================
--- trunk/boost/asio/detail/posix_mutex.hpp (original)
+++ trunk/boost/asio/detail/posix_mutex.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <pthread.h>
 #include <boost/asio/detail/noncopyable.hpp>
@@ -73,6 +73,6 @@
 # include <boost/asio/detail/impl/posix_mutex.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_POSIX_MUTEX_HPP

Modified: trunk/boost/asio/detail/posix_signal_blocker.hpp
==============================================================================
--- trunk/boost/asio/detail/posix_signal_blocker.hpp (original)
+++ trunk/boost/asio/detail/posix_signal_blocker.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <csignal>
 #include <pthread.h>
@@ -82,6 +82,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_POSIX_SIGNAL_BLOCKER_HPP

Modified: trunk/boost/asio/detail/posix_static_mutex.hpp
==============================================================================
--- trunk/boost/asio/detail/posix_static_mutex.hpp (original)
+++ trunk/boost/asio/detail/posix_static_mutex.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <pthread.h>
 #include <boost/asio/detail/scoped_lock.hpp>
@@ -61,6 +61,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_POSIX_STATIC_MUTEX_HPP

Modified: trunk/boost/asio/detail/posix_thread.hpp
==============================================================================
--- trunk/boost/asio/detail/posix_thread.hpp (original)
+++ trunk/boost/asio/detail/posix_thread.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <pthread.h>
 #include <boost/asio/detail/noncopyable.hpp>
@@ -102,6 +102,6 @@
 # include <boost/asio/detail/impl/posix_thread.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_POSIX_THREAD_HPP

Modified: trunk/boost/asio/detail/posix_tss_ptr.hpp
==============================================================================
--- trunk/boost/asio/detail/posix_tss_ptr.hpp (original)
+++ trunk/boost/asio/detail/posix_tss_ptr.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <pthread.h>
 #include <boost/asio/detail/noncopyable.hpp>
@@ -77,6 +77,6 @@
 # include <boost/asio/detail/impl/posix_tss_ptr.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_POSIX_TSS_PTR_HPP

Modified: trunk/boost/asio/detail/reactive_descriptor_service.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_descriptor_service.hpp (original)
+++ trunk/boost/asio/detail/reactive_descriptor_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,11 +17,11 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/descriptor_ops.hpp>
@@ -193,7 +193,7 @@
 
     // Allocate and construct an operation to wrap the handler.
     typedef descriptor_write_op<ConstBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.descriptor_, buffers, handler);
@@ -216,7 +216,7 @@
 
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -261,7 +261,7 @@
 
     // Allocate and construct an operation to wrap the handler.
     typedef descriptor_read_op<MutableBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.descriptor_, buffers, handler);
@@ -284,7 +284,7 @@
 
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -315,6 +315,6 @@
 # include <boost/asio/detail/impl/reactive_descriptor_service.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_REACTIVE_DESCRIPTOR_SERVICE_HPP

Modified: trunk/boost/asio/detail/reactive_null_buffers_op.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_null_buffers_op.hpp (original)
+++ trunk/boost/asio/detail/reactive_null_buffers_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
@@ -52,7 +52,7 @@
   {
     // Take ownership of the handler object.
     reactive_null_buffers_op* o(static_cast<reactive_null_buffers_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -64,7 +64,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/reactive_serial_port_service.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_serial_port_service.hpp (original)
+++ trunk/boost/asio/detail/reactive_serial_port_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,7 +19,7 @@
 #include <boost/asio/detail/config.hpp>
 
 #if defined(BOOST_ASIO_HAS_SERIAL_PORT)
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <string>
 #include <boost/asio/error.hpp>
@@ -230,7 +230,7 @@
 # include <boost/asio/detail/impl/reactive_serial_port_service.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 #endif // defined(BOOST_ASIO_HAS_SERIAL_PORT)
 
 #endif // BOOST_ASIO_DETAIL_REACTIVE_SERIAL_PORT_SERVICE_HPP

Modified: trunk/boost/asio/detail/reactive_socket_accept_op.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_accept_op.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_accept_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -100,7 +100,7 @@
   {
     // Take ownership of the handler object.
     reactive_socket_accept_op* o(static_cast<reactive_socket_accept_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -112,7 +112,7 @@
     // deallocated the memory here.
     detail::binder1<Handler, boost::system::error_code>
       handler(o->handler_, o->ec_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/reactive_socket_connect_op.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_connect_op.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_connect_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -70,7 +70,7 @@
     // Take ownership of the handler object.
     reactive_socket_connect_op* o
       (static_cast<reactive_socket_connect_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -82,7 +82,7 @@
     // deallocated the memory here.
     detail::binder1<Handler, boost::system::error_code>
       handler(o->handler_, o->ec_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/reactive_socket_recv_op.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_recv_op.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_recv_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -87,7 +87,7 @@
   {
     // Take ownership of the handler object.
     reactive_socket_recv_op* o(static_cast<reactive_socket_recv_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -99,7 +99,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/reactive_socket_recvfrom_op.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_recvfrom_op.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_recvfrom_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -97,7 +97,7 @@
     // Take ownership of the handler object.
     reactive_socket_recvfrom_op* o(
         static_cast<reactive_socket_recvfrom_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -109,7 +109,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/reactive_socket_recvmsg_op.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_recvmsg_op.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_recvmsg_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -89,7 +89,7 @@
     // Take ownership of the handler object.
     reactive_socket_recvmsg_op* o(
         static_cast<reactive_socket_recvmsg_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -101,7 +101,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/reactive_socket_send_op.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_send_op.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_send_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -84,7 +84,7 @@
   {
     // Take ownership of the handler object.
     reactive_socket_send_op* o(static_cast<reactive_socket_send_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -96,7 +96,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/reactive_socket_sendto_op.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_sendto_op.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_sendto_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -87,7 +87,7 @@
   {
     // Take ownership of the handler object.
     reactive_socket_sendto_op* o(static_cast<reactive_socket_sendto_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -99,7 +99,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/reactive_socket_service.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_service.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,11 +19,11 @@
 
 #if !defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/socket_base.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/reactive_null_buffers_op.hpp>
@@ -223,7 +223,7 @@
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_sendto_op<ConstBufferSequence,
         endpoint_type, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.socket_, buffers, destination, flags, handler);
@@ -244,7 +244,7 @@
 
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -306,7 +306,7 @@
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_recvfrom_op<MutableBufferSequence,
         endpoint_type, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     int protocol = impl.protocol_.type();
@@ -334,7 +334,7 @@
 
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -392,7 +392,7 @@
 
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_accept_op<Socket, Protocol, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.socket_, impl.state_, peer,
@@ -423,7 +423,7 @@
 
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_connect_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.socket_, handler);

Modified: trunk/boost/asio/detail/reactive_socket_service_base.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_service_base.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_service_base.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,11 +19,11 @@
 
 #if !defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/socket_base.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/reactive_null_buffers_op.hpp>
 #include <boost/asio/detail/reactive_socket_recv_op.hpp>
@@ -205,7 +205,7 @@
 
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_send_op<ConstBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.socket_, buffers, flags, handler);
@@ -229,7 +229,7 @@
 
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -276,7 +276,7 @@
 
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_recv_op<MutableBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.socket_, impl.state_, buffers, flags, handler);
@@ -304,7 +304,7 @@
 
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -361,7 +361,7 @@
 
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_recvmsg_op<MutableBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.socket_, buffers, in_flags, out_flags, handler);
@@ -388,7 +388,7 @@
 
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);

Modified: trunk/boost/asio/detail/regex_fwd.hpp
==============================================================================
--- trunk/boost/asio/detail/regex_fwd.hpp (original)
+++ trunk/boost/asio/detail/regex_fwd.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -15,6 +15,8 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
+#if defined(BOOST_ASIO_HAS_BOOST_REGEX)
+
 #include <boost/regex_fwd.hpp>
 #include <boost/regex/v4/match_flags.hpp>
 
@@ -28,4 +30,6 @@
 
 } // namespace boost
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
+
 #endif // BOOST_ASIO_DETAIL_REGEX_FWD_HPP

Modified: trunk/boost/asio/detail/resolve_endpoint_op.hpp
==============================================================================
--- trunk/boost/asio/detail/resolve_endpoint_op.hpp (original)
+++ trunk/boost/asio/detail/resolve_endpoint_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,10 +16,10 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/ip/basic_resolver_iterator.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
@@ -58,7 +58,7 @@
   {
     // Take ownership of the operation object.
     resolve_endpoint_op* o(static_cast<resolve_endpoint_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     if (owner && owner != &o->io_service_impl_)
     {
@@ -92,7 +92,7 @@
       // after we have deallocated the memory here.
       detail::binder2<Handler, boost::system::error_code, iterator_type>
         handler(o->handler_, o->ec_, o->iter_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
       p.reset();
 
       if (owner)

Modified: trunk/boost/asio/detail/resolve_op.hpp
==============================================================================
--- trunk/boost/asio/detail/resolve_op.hpp (original)
+++ trunk/boost/asio/detail/resolve_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,11 +16,11 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/ip/basic_resolver_iterator.hpp>
 #include <boost/asio/ip/basic_resolver_query.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
@@ -66,7 +66,7 @@
   {
     // Take ownership of the operation object.
     resolve_op* o(static_cast<resolve_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     if (owner && owner != &o->io_service_impl_)
     {
@@ -97,7 +97,7 @@
       // after we have deallocated the memory here.
       detail::binder2<Handler, boost::system::error_code, iterator_type>
         handler(o->handler_, o->ec_, iterator_type());
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
       if (o->addrinfo_)
       {
         handler.arg2_ = iterator_type::create(o->addrinfo_,

Modified: trunk/boost/asio/detail/resolver_service.hpp
==============================================================================
--- trunk/boost/asio/detail/resolver_service.hpp (original)
+++ trunk/boost/asio/detail/resolver_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,6 +18,7 @@
 #include <boost/asio/detail/config.hpp>
 #include <boost/asio/ip/basic_resolver_iterator.hpp>
 #include <boost/asio/ip/basic_resolver_query.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/resolve_endpoint_op.hpp>
 #include <boost/asio/detail/resolve_op.hpp>
 #include <boost/asio/detail/resolver_service_base.hpp>
@@ -72,7 +73,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef resolve_op<Protocol, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl, query, io_service_impl_, handler);
@@ -104,7 +105,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef resolve_endpoint_op<Protocol, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl, endpoint, io_service_impl_, handler);

Modified: trunk/boost/asio/detail/select_interrupter.hpp
==============================================================================
--- trunk/boost/asio/detail/select_interrupter.hpp (original)
+++ trunk/boost/asio/detail/select_interrupter.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
 # include <boost/asio/detail/socket_select_interrupter.hpp>
 #elif defined(BOOST_ASIO_HAS_EVENTFD)
 # include <boost/asio/detail/eventfd_select_interrupter.hpp>
@@ -29,7 +29,7 @@
 namespace asio {
 namespace detail {
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
 typedef socket_select_interrupter select_interrupter;
 #elif defined(BOOST_ASIO_HAS_EVENTFD)
 typedef eventfd_select_interrupter select_interrupter;

Modified: trunk/boost/asio/detail/select_reactor.hpp
==============================================================================
--- trunk/boost/asio/detail/select_reactor.hpp (original)
+++ trunk/boost/asio/detail/select_reactor.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -22,9 +22,9 @@
       && !defined(BOOST_ASIO_HAS_EPOLL) \
       && !defined(BOOST_ASIO_HAS_KQUEUE))
 
-#include <boost/limits.hpp>
 #include <cstddef>
 #include <boost/asio/detail/fd_set_adapter.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/mutex.hpp>
 #include <boost/asio/detail/op_queue.hpp>
 #include <boost/asio/detail/reactor_op.hpp>
@@ -52,13 +52,13 @@
   : public boost::asio::detail::service_base<select_reactor>
 {
 public:
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   enum op_types { read_op = 0, write_op = 1, except_op = 2,
     max_select_ops = 3, connect_op = 3, max_ops = 4 };
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   enum op_types { read_op = 0, write_op = 1, except_op = 2,
     max_select_ops = 3, connect_op = 1, max_ops = 3 };
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
   // Per-descriptor data.
   struct per_descriptor_data

Modified: trunk/boost/asio/detail/service_registry.hpp
==============================================================================
--- trunk/boost/asio/detail/service_registry.hpp (original)
+++ trunk/boost/asio/detail/service_registry.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -21,12 +21,6 @@
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/io_service.hpp>
 
-#if defined(BOOST_NO_TYPEID)
-# if !defined(BOOST_ASIO_NO_TYPEID)
-# define BOOST_ASIO_NO_TYPEID
-# endif // !defined(BOOST_ASIO_NO_TYPEID)
-#endif // defined(BOOST_NO_TYPEID)
-
 #include <boost/asio/detail/push_options.hpp>
 
 namespace boost {

Modified: trunk/boost/asio/detail/signal_blocker.hpp
==============================================================================
--- trunk/boost/asio/detail/signal_blocker.hpp (original)
+++ trunk/boost/asio/detail/signal_blocker.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,10 +17,10 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS) \
- || defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
+#if !defined(BOOST_ASIO_HAS_THREADS) || defined(BOOST_ASIO_WINDOWS) \
+ || defined(__CYGWIN__) || defined(__SYMBIAN32__)
 # include <boost/asio/detail/null_signal_blocker.hpp>
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 # include <boost/asio/detail/posix_signal_blocker.hpp>
 #else
 # error Only Windows and POSIX are supported!
@@ -30,10 +30,10 @@
 namespace asio {
 namespace detail {
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS) \
- || defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
+#if !defined(BOOST_ASIO_HAS_THREADS) || defined(BOOST_ASIO_WINDOWS) \
+ || defined(__CYGWIN__) || defined(__SYMBIAN32__)
 typedef null_signal_blocker signal_blocker;
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 typedef posix_signal_blocker signal_blocker;
 #endif
 

Modified: trunk/boost/asio/detail/signal_handler.hpp
==============================================================================
--- trunk/boost/asio/detail/signal_handler.hpp (original)
+++ trunk/boost/asio/detail/signal_handler.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,6 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
@@ -45,7 +46,7 @@
   {
     // Take ownership of the handler object.
     signal_handler* h(static_cast<signal_handler*>(base));
- ptr p = { boost::addressof(h->handler_), h, h };
+ ptr p = { boost::asio::detail::addressof(h->handler_), h, h };
 
     BOOST_ASIO_HANDLER_COMPLETION((h));
 
@@ -57,7 +58,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, int>
       handler(h->handler_, h->ec_, h->signal_number_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/signal_init.hpp
==============================================================================
--- trunk/boost/asio/detail/signal_init.hpp (original)
+++ trunk/boost/asio/detail/signal_init.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <csignal>
 
@@ -44,6 +44,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_SIGNAL_INIT_HPP

Modified: trunk/boost/asio/detail/signal_set_service.hpp
==============================================================================
--- trunk/boost/asio/detail/signal_set_service.hpp (original)
+++ trunk/boost/asio/detail/signal_set_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -21,15 +21,16 @@
 #include <signal.h>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/op_queue.hpp>
 #include <boost/asio/detail/signal_handler.hpp>
 #include <boost/asio/detail/signal_op.hpp>
 #include <boost/asio/detail/socket_types.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 # include <boost/asio/detail/reactor.hpp>
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -148,7 +149,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef signal_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -181,7 +182,7 @@
   // The io_service instance used for dispatching handlers.
   io_service_impl& io_service_;
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   // The type used for registering for pipe reactor notifications.
   class pipe_read_op;
 
@@ -190,7 +191,7 @@
 
   // The per-descriptor reactor data used for the pipe.
   reactor::per_descriptor_data reactor_data_;
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
   // A mapping from signal number to the registered signal sets.
   registration* registrations_[max_signal_number];

Modified: trunk/boost/asio/detail/socket_ops.hpp
==============================================================================
--- trunk/boost/asio/detail/socket_ops.hpp (original)
+++ trunk/boost/asio/detail/socket_ops.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -119,11 +119,11 @@
 BOOST_ASIO_DECL int listen(socket_type s,
     int backlog, boost::system::error_code& ec);
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 typedef WSABUF buf;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 typedef iovec buf;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 BOOST_ASIO_DECL void init_buf(buf& b, void* data, size_t size);
 

Modified: trunk/boost/asio/detail/socket_option.hpp
==============================================================================
--- trunk/boost/asio/detail/socket_option.hpp (original)
+++ trunk/boost/asio/detail/socket_option.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
 #include <stdexcept>
-#include <boost/config.hpp>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/detail/socket_types.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -123,7 +122,7 @@
     default:
       {
         std::length_error ex("boolean socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
       }
     }
   }
@@ -204,7 +203,7 @@
     if (s != sizeof(value_))
     {
       std::length_error ex("integer socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
     }
   }
 
@@ -228,7 +227,7 @@
   linger(bool e, int t)
   {
     enabled(e);
- timeout BOOST_PREVENT_MACRO_SUBSTITUTION(t);
+ timeout BOOST_ASIO_PREVENT_MACRO_SUBSTITUTION(t);
   }
 
   // Set the value for whether linger is enabled.
@@ -244,7 +243,7 @@
   }
 
   // Set the value for the linger timeout.
- void timeout BOOST_PREVENT_MACRO_SUBSTITUTION(int value)
+ void timeout BOOST_ASIO_PREVENT_MACRO_SUBSTITUTION(int value)
   {
 #if defined(WIN32)
     value_.l_linger = static_cast<u_short>(value);
@@ -254,7 +253,7 @@
   }
 
   // Get the value for the linger timeout.
- int timeout BOOST_PREVENT_MACRO_SUBSTITUTION() const
+ int timeout BOOST_ASIO_PREVENT_MACRO_SUBSTITUTION() const
   {
     return static_cast<int>(value_.l_linger);
   }
@@ -301,7 +300,7 @@
     if (s != sizeof(value_))
     {
       std::length_error ex("linger socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
     }
   }
 

Modified: trunk/boost/asio/detail/socket_select_interrupter.hpp
==============================================================================
--- trunk/boost/asio/detail/socket_select_interrupter.hpp (original)
+++ trunk/boost/asio/detail/socket_select_interrupter.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) \
+#if defined(BOOST_ASIO_WINDOWS) \
   || defined(__CYGWIN__) \
   || defined(__SYMBIAN32__)
 
@@ -82,7 +82,7 @@
 # include <boost/asio/detail/impl/socket_select_interrupter.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
        // || defined(__CYGWIN__)
        // || defined(__SYMBIAN32__)
 

Modified: trunk/boost/asio/detail/socket_types.hpp
==============================================================================
--- trunk/boost/asio/detail/socket_types.hpp (original)
+++ trunk/boost/asio/detail/socket_types.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_)
 # error WinSock.h has already been included
 # endif // defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_)
@@ -81,7 +81,7 @@
 namespace asio {
 namespace detail {
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 typedef SOCKET socket_type;
 const SOCKET invalid_socket = INVALID_SOCKET;
 const int socket_error_retval = SOCKET_ERROR;

Modified: trunk/boost/asio/detail/static_mutex.hpp
==============================================================================
--- trunk/boost/asio/detail/static_mutex.hpp (original)
+++ trunk/boost/asio/detail/static_mutex.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,11 +17,11 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 # include <boost/asio/detail/null_static_mutex.hpp>
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 # include <boost/asio/detail/win_static_mutex.hpp>
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 # include <boost/asio/detail/posix_static_mutex.hpp>
 #else
 # error Only Windows and POSIX are supported!
@@ -31,13 +31,13 @@
 namespace asio {
 namespace detail {
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 typedef null_static_mutex static_mutex;
 # define BOOST_ASIO_STATIC_MUTEX_INIT BOOST_ASIO_NULL_STATIC_MUTEX_INIT
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 typedef win_static_mutex static_mutex;
 # define BOOST_ASIO_STATIC_MUTEX_INIT BOOST_ASIO_WIN_STATIC_MUTEX_INIT
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 typedef posix_static_mutex static_mutex;
 # define BOOST_ASIO_STATIC_MUTEX_INIT BOOST_ASIO_POSIX_STATIC_MUTEX_INIT
 #endif

Modified: trunk/boost/asio/detail/thread.hpp
==============================================================================
--- trunk/boost/asio/detail/thread.hpp (original)
+++ trunk/boost/asio/detail/thread.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,15 +17,15 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 # include <boost/asio/detail/null_thread.hpp>
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 # if defined(UNDER_CE)
 # include <boost/asio/detail/wince_thread.hpp>
 # else
 # include <boost/asio/detail/win_thread.hpp>
 # endif
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 # include <boost/asio/detail/posix_thread.hpp>
 #else
 # error Only Windows and POSIX are supported!
@@ -35,15 +35,15 @@
 namespace asio {
 namespace detail {
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 typedef null_thread thread;
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 # if defined(UNDER_CE)
 typedef wince_thread thread;
 # else
 typedef win_thread thread;
 # endif
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 typedef posix_thread thread;
 #endif
 

Added: trunk/boost/asio/detail/throw_exception.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/detail/throw_exception.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -0,0 +1,53 @@
+//
+// detail/throw_exception.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_THROW_EXCEPTION_HPP
+#define BOOST_ASIO_DETAIL_THROW_EXCEPTION_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
+# include <boost/throw_exception.hpp>
+#endif // defined(BOOST_ASIO_BOOST_THROW_EXCEPTION)
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+#if defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
+using boost::throw_exception;
+#else // defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
+
+// Declare the throw_exception function for all targets.
+template <typename Exception>
+void throw_exception(const Exception& e);
+
+// Only define the throw_exception function when exceptions are enabled.
+// Otherwise, it is up to the application to provide a definition of this
+// function.
+# if !defined(BOOST_ASIO_NO_EXCEPTIONS)
+template <typename Exception>
+void throw_exception(const Exception& e)
+{
+ throw e;
+}
+# endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
+
+#endif // defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#endif // BOOST_ASIO_DETAIL_THROW_EXCEPTION_HPP

Modified: trunk/boost/asio/detail/timer_queue.hpp
==============================================================================
--- trunk/boost/asio/detail/timer_queue.hpp (original)
+++ trunk/boost/asio/detail/timer_queue.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,10 +18,9 @@
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
 #include <vector>
-#include <boost/config.hpp>
-#include <boost/limits.hpp>
-#include <boost/cstdint.hpp>
+#include <boost/asio/detail/cstdint.hpp>
 #include <boost/asio/detail/date_time_fwd.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/op_queue.hpp>
 #include <boost/asio/detail/timer_queue_base.hpp>
 #include <boost/asio/detail/wait_op.hpp>
@@ -288,7 +287,7 @@
   {
     if (d.ticks() <= 0)
       return 0;
- boost::int64_t msec = d.total_milliseconds();
+ int64_t msec = d.total_milliseconds();
     if (msec == 0)
       return 1;
     if (msec > max_duration)
@@ -302,7 +301,7 @@
   {
     if (d.ticks() <= 0)
       return 0;
- boost::int64_t usec = d.total_microseconds();
+ int64_t usec = d.total_microseconds();
     if (usec == 0)
       return 1;
     if (usec > max_duration)

Modified: trunk/boost/asio/detail/timer_queue_ptime.hpp
==============================================================================
--- trunk/boost/asio/detail/timer_queue_ptime.hpp (original)
+++ trunk/boost/asio/detail/timer_queue_ptime.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -20,6 +20,8 @@
 
 #include <boost/asio/detail/push_options.hpp>
 
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
 namespace boost {
 namespace asio {
 namespace detail {
@@ -82,6 +84,8 @@
 } // namespace asio
 } // namespace boost
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
 #include <boost/asio/detail/pop_options.hpp>
 
 #if defined(BOOST_ASIO_HEADER_ONLY)

Modified: trunk/boost/asio/detail/tss_ptr.hpp
==============================================================================
--- trunk/boost/asio/detail/tss_ptr.hpp (original)
+++ trunk/boost/asio/detail/tss_ptr.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,13 +17,13 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 # include <boost/asio/detail/null_tss_ptr.hpp>
 #elif defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
 # include <boost/asio/detail/keyword_tss_ptr.hpp>
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 # include <boost/asio/detail/win_tss_ptr.hpp>
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 # include <boost/asio/detail/posix_tss_ptr.hpp>
 #else
 # error Only Windows and POSIX are supported!
@@ -37,26 +37,26 @@
 
 template <typename T>
 class tss_ptr
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
   : public null_tss_ptr<T>
 #elif defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
   : public keyword_tss_ptr<T>
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
   : public win_tss_ptr<T>
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
   : public posix_tss_ptr<T>
 #endif
 {
 public:
   void operator=(T* value)
   {
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
     null_tss_ptr<T>::operator=(value);
 #elif defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
     keyword_tss_ptr<T>::operator=(value);
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
     win_tss_ptr<T>::operator=(value);
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
     posix_tss_ptr<T>::operator=(value);
 #endif
   }

Added: trunk/boost/asio/detail/type_traits.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/detail/type_traits.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -0,0 +1,60 @@
+//
+// detail/type_traits.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_TYPE_TRAITS_HPP
+#define BOOST_ASIO_DETAIL_TYPE_TRAITS_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
+# include <type_traits>
+#else // defined(BOOST_ASIO_HAS_TYPE_TRAITS)
+# include <boost/type_traits/add_const.hpp>
+# include <boost/type_traits/is_const.hpp>
+# include <boost/type_traits/is_convertible.hpp>
+# include <boost/type_traits/is_function.hpp>
+# include <boost/type_traits/is_same.hpp>
+# include <boost/type_traits/remove_pointer.hpp>
+# include <boost/type_traits/remove_reference.hpp>
+# include <boost/utility/enable_if.hpp>
+#endif // defined(BOOST_ASIO_HAS_TYPE_TRAITS)
+
+namespace boost {
+namespace asio {
+
+#if defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
+using std::add_const;
+using std::enable_if;
+using std::is_const;
+using std::is_convertible;
+using std::is_function;
+using std::is_same;
+using std::remove_pointer;
+using std::remove_reference;
+#else // defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
+using boost::add_const;
+template <bool Condition, typename Type = void>
+struct enable_if : boost::enable_if_c<Condition, Type> {};
+using boost::is_const;
+using boost::is_convertible;
+using boost::is_function;
+using boost::is_same;
+using boost::remove_pointer;
+using boost::remove_reference;
+#endif // defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
+
+} // namespace asio
+} // namespace boost
+
+#endif // BOOST_ASIO_DETAIL_TYPE_TRAITS_HPP

Modified: trunk/boost/asio/detail/wait_handler.hpp
==============================================================================
--- trunk/boost/asio/detail/wait_handler.hpp (original)
+++ trunk/boost/asio/detail/wait_handler.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,6 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
@@ -46,7 +47,7 @@
   {
     // Take ownership of the handler object.
     wait_handler* h(static_cast<wait_handler*>(base));
- ptr p = { boost::addressof(h->handler_), h, h };
+ ptr p = { boost::asio::detail::addressof(h->handler_), h, h };
 
     BOOST_ASIO_HANDLER_COMPLETION((h));
 
@@ -58,7 +59,7 @@
     // deallocated the memory here.
     detail::binder1<Handler, boost::system::error_code>
       handler(h->handler_, h->ec_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/win_event.hpp
==============================================================================
--- trunk/boost/asio/detail/win_event.hpp (original)
+++ trunk/boost/asio/detail/win_event.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,9 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
-#include <boost/assert.hpp>
+#include <boost/asio/detail/assert.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/socket_types.hpp>
 
@@ -46,7 +46,7 @@
   template <typename Lock>
   void signal(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     (void)lock;
     ::SetEvent(event_);
   }
@@ -55,7 +55,7 @@
   template <typename Lock>
   void signal_and_unlock(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     lock.unlock();
     ::SetEvent(event_);
   }
@@ -64,7 +64,7 @@
   template <typename Lock>
   void clear(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     (void)lock;
     ::ResetEvent(event_);
   }
@@ -73,7 +73,7 @@
   template <typename Lock>
   void wait(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     lock.unlock();
     ::WaitForSingleObject(event_, INFINITE);
     lock.lock();
@@ -93,6 +93,6 @@
 # include <boost/asio/detail/impl/win_event.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_WIN_EVENT_HPP

Modified: trunk/boost/asio/detail/win_fd_set_adapter.hpp
==============================================================================
--- trunk/boost/asio/detail/win_fd_set_adapter.hpp (original)
+++ trunk/boost/asio/detail/win_fd_set_adapter.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/socket_types.hpp>
@@ -120,6 +120,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_WIN_FD_SET_ADAPTER_HPP

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 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 
 #include <boost/asio/detail/socket_types.hpp>
 
@@ -45,7 +45,8 @@
 #if defined(__BORLANDC__)
     LONG barrier = 0;
     ::InterlockedExchange(&barrier, 1);
-#elif defined(BOOST_MSVC) && ((BOOST_MSVC < 1400) || !defined(MemoryBarrier))
+#elif defined(BOOST_ASIO_MSVC) \
+ && ((BOOST_ASIO_MSVC < 1400) || !defined(MemoryBarrier))
 # if defined(_M_IX86)
 # pragma warning(push)
 # pragma warning(disable:4793)
@@ -64,7 +65,8 @@
 #if defined(__BORLANDC__)
     LONG barrier = 0;
     ::InterlockedExchange(&barrier, 1);
-#elif defined(BOOST_MSVC) && ((BOOST_MSVC < 1400) || !defined(MemoryBarrier))
+#elif defined(BOOST_ASIO_MSVC) \
+ && ((BOOST_ASIO_MSVC < 1400) || !defined(MemoryBarrier))
 # if defined(_M_IX86)
 # pragma warning(push)
 # pragma warning(disable:4793)
@@ -84,6 +86,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 
 #endif // BOOST_ASIO_DETAIL_WIN_FENCED_BLOCK_HPP

Modified: trunk/boost/asio/detail/win_iocp_handle_read_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_handle_read_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_handle_read_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -21,7 +21,7 @@
 #if defined(BOOST_ASIO_HAS_IOCP)
 
 #include <boost/asio/error.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -57,7 +57,7 @@
 
     // Take ownership of the operation object.
     win_iocp_handle_read_op* o(static_cast<win_iocp_handle_read_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -82,7 +82,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/win_iocp_handle_service.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_handle_service.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_handle_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -20,10 +20,11 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/cstdint.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
+#include <boost/asio/detail/cstdint.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/mutex.hpp>
 #include <boost/asio/detail/operation.hpp>
@@ -129,7 +130,7 @@
   // Write the given data at the specified offset. Returns the number of bytes
   // written.
   template <typename ConstBufferSequence>
- size_t write_some_at(implementation_type& impl, boost::uint64_t offset,
+ size_t write_some_at(implementation_type& impl, uint64_t offset,
       const ConstBufferSequence& buffers, boost::system::error_code& ec)
   {
     boost::asio::const_buffer buffer =
@@ -147,7 +148,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_handle_write_op<ConstBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(buffers, handler);
@@ -163,12 +164,12 @@
   // Start an asynchronous write at a specified offset. The data being written
   // must be valid for the lifetime of the asynchronous operation.
   template <typename ConstBufferSequence, typename Handler>
- void async_write_some_at(implementation_type& impl, boost::uint64_t offset,
+ void async_write_some_at(implementation_type& impl, uint64_t offset,
       const ConstBufferSequence& buffers, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_handle_write_op<ConstBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(buffers, handler);
@@ -191,7 +192,7 @@
 
   // Read some data at a specified offset. Returns the number of bytes received.
   template <typename MutableBufferSequence>
- size_t read_some_at(implementation_type& impl, boost::uint64_t offset,
+ size_t read_some_at(implementation_type& impl, uint64_t offset,
       const MutableBufferSequence& buffers, boost::system::error_code& ec)
   {
     boost::asio::mutable_buffer buffer =
@@ -209,7 +210,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_handle_read_op<MutableBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(buffers, handler);
@@ -226,12 +227,12 @@
   // being received must be valid for the lifetime of the asynchronous
   // operation.
   template <typename MutableBufferSequence, typename Handler>
- void async_read_some_at(implementation_type& impl, boost::uint64_t offset,
+ void async_read_some_at(implementation_type& impl, uint64_t offset,
       const MutableBufferSequence& buffers, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_handle_read_op<MutableBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(buffers, handler);
@@ -248,23 +249,23 @@
   // Prevent the use of the null_buffers type with this service.
   size_t write_some(implementation_type& impl,
       const null_buffers& buffers, boost::system::error_code& ec);
- size_t write_some_at(implementation_type& impl, boost::uint64_t offset,
+ size_t write_some_at(implementation_type& impl, uint64_t offset,
       const null_buffers& buffers, boost::system::error_code& ec);
   template <typename Handler>
   void async_write_some(implementation_type& impl,
       const null_buffers& buffers, Handler& handler);
   template <typename Handler>
- void async_write_some_at(implementation_type& impl, boost::uint64_t offset,
+ void async_write_some_at(implementation_type& impl, uint64_t offset,
       const null_buffers& buffers, Handler& handler);
   size_t read_some(implementation_type& impl,
       const null_buffers& buffers, boost::system::error_code& ec);
- size_t read_some_at(implementation_type& impl, boost::uint64_t offset,
+ size_t read_some_at(implementation_type& impl, uint64_t offset,
       const null_buffers& buffers, boost::system::error_code& ec);
   template <typename Handler>
   void async_read_some(implementation_type& impl,
       const null_buffers& buffers, Handler& handler);
   template <typename Handler>
- void async_read_some_at(implementation_type& impl, boost::uint64_t offset,
+ void async_read_some_at(implementation_type& impl, uint64_t offset,
       const null_buffers& buffers, Handler& handler);
 
   // Helper class for waiting for synchronous operations to complete.
@@ -272,22 +273,22 @@
 
   // Helper function to perform a synchronous write operation.
   BOOST_ASIO_DECL size_t do_write(implementation_type& impl,
- boost::uint64_t offset, const boost::asio::const_buffer& buffer,
+ uint64_t offset, const boost::asio::const_buffer& buffer,
       boost::system::error_code& ec);
 
   // Helper function to start a write operation.
   BOOST_ASIO_DECL void start_write_op(implementation_type& impl,
- boost::uint64_t offset, const boost::asio::const_buffer& buffer,
+ uint64_t offset, const boost::asio::const_buffer& buffer,
       operation* op);
 
   // Helper function to perform a synchronous write operation.
   BOOST_ASIO_DECL size_t do_read(implementation_type& impl,
- boost::uint64_t offset, const boost::asio::mutable_buffer& buffer,
+ uint64_t offset, const boost::asio::mutable_buffer& buffer,
       boost::system::error_code& ec);
 
   // Helper function to start a read operation.
   BOOST_ASIO_DECL void start_read_op(implementation_type& impl,
- boost::uint64_t offset, const boost::asio::mutable_buffer& buffer,
+ uint64_t offset, const boost::asio::mutable_buffer& buffer,
       operation* op);
 
   // Update the ID of the thread from which cancellation is safe.

Modified: trunk/boost/asio/detail/win_iocp_handle_write_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_handle_write_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_handle_write_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -21,7 +21,7 @@
 #if defined(BOOST_ASIO_HAS_IOCP)
 
 #include <boost/asio/error.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -53,7 +53,7 @@
   {
     // Take ownership of the operation object.
     win_iocp_handle_write_op* o(static_cast<win_iocp_handle_write_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -74,7 +74,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/win_iocp_io_service.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_io_service.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_io_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,9 +19,9 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/limits.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/detail/call_stack.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/mutex.hpp>
 #include <boost/asio/detail/op_queue.hpp>
 #include <boost/asio/detail/scoped_ptr.hpp>

Modified: trunk/boost/asio/detail/win_iocp_null_buffers_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_null_buffers_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_null_buffers_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,7 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -63,7 +63,7 @@
 
     // Take ownership of the operation object.
     win_iocp_null_buffers_op* o(static_cast<win_iocp_null_buffers_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -92,7 +92,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/win_iocp_overlapped_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_overlapped_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_overlapped_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -20,7 +20,7 @@
 #if defined(BOOST_ASIO_HAS_IOCP)
 
 #include <boost/asio/error.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
@@ -50,7 +50,7 @@
   {
     // Take ownership of the operation object.
     win_iocp_overlapped_op* o(static_cast<win_iocp_overlapped_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -62,7 +62,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/win_iocp_overlapped_ptr.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_overlapped_ptr.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_overlapped_ptr.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,8 +19,8 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/win_iocp_overlapped_op.hpp>
@@ -78,7 +78,7 @@
   void reset(boost::asio::io_service& io_service, Handler handler)
   {
     typedef win_iocp_overlapped_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);

Modified: trunk/boost/asio/detail/win_iocp_socket_accept_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_socket_accept_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_socket_accept_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,7 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -80,7 +80,7 @@
 
     // Take ownership of the operation object.
     win_iocp_socket_accept_op* o(static_cast<win_iocp_socket_accept_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     if (owner)
     {
@@ -131,7 +131,7 @@
     // deallocated the memory here.
     detail::binder1<Handler, boost::system::error_code>
       handler(o->handler_, ec);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/win_iocp_socket_recv_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_socket_recv_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_socket_recv_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,7 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -60,7 +60,7 @@
 
     // Take ownership of the operation object.
     win_iocp_socket_recv_op* o(static_cast<win_iocp_socket_recv_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -86,7 +86,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,7 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -67,7 +67,7 @@
     // Take ownership of the operation object.
     win_iocp_socket_recvfrom_op* o(
         static_cast<win_iocp_socket_recvfrom_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -93,7 +93,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/win_iocp_socket_recvmsg_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_socket_recvmsg_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_socket_recvmsg_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,7 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -63,7 +63,7 @@
     // Take ownership of the operation object.
     win_iocp_socket_recvmsg_op* o(
         static_cast<win_iocp_socket_recvmsg_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -87,7 +87,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/win_iocp_socket_send_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_socket_send_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_socket_send_op.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,7 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -58,7 +58,7 @@
 
     // Take ownership of the operation object.
     win_iocp_socket_send_op* o(static_cast<win_iocp_socket_send_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -81,7 +81,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: trunk/boost/asio/detail/win_iocp_socket_service.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_socket_service.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_socket_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -20,10 +20,10 @@
 #if defined(BOOST_ASIO_HAS_IOCP)
 
 #include <cstring>
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/socket_base.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -295,7 +295,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_socket_send_op<ConstBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, buffers, handler);
@@ -318,7 +318,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, handler);
@@ -377,7 +377,7 @@
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_socket_recvfrom_op<
       MutableBufferSequence, endpoint_type, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(sender_endp, impl.cancel_token_, buffers, handler);
@@ -400,7 +400,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, handler);
@@ -452,7 +452,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_socket_accept_op<Socket, protocol_type, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     bool enable_connection_aborted =
@@ -485,7 +485,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_connect_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.socket_, handler);

Modified: trunk/boost/asio/detail/win_iocp_socket_service_base.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_socket_service_base.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_socket_service_base.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,11 +19,10 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/type_traits/is_same.hpp>
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/socket_base.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -220,7 +219,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_socket_send_op<ConstBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, buffers, handler);
@@ -243,7 +242,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, handler);
@@ -287,7 +286,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_socket_recv_op<MutableBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.state_, impl.cancel_token_, buffers, handler);
@@ -310,7 +309,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, handler);
@@ -361,7 +360,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_socket_recvmsg_op<MutableBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, buffers, out_flags, handler);
@@ -384,7 +383,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, handler);

Modified: trunk/boost/asio/detail/win_mutex.hpp
==============================================================================
--- trunk/boost/asio/detail/win_mutex.hpp (original)
+++ trunk/boost/asio/detail/win_mutex.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/scoped_lock.hpp>
@@ -75,6 +75,6 @@
 # include <boost/asio/detail/impl/win_mutex.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_WIN_MUTEX_HPP

Modified: trunk/boost/asio/detail/win_object_handle_service.hpp
==============================================================================
--- trunk/boost/asio/detail/win_object_handle_service.hpp (original)
+++ trunk/boost/asio/detail/win_object_handle_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -20,7 +20,7 @@
 
 #if defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/wait_handler.hpp>
 #include <boost/asio/error.hpp>
@@ -134,7 +134,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef wait_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);

Modified: trunk/boost/asio/detail/win_static_mutex.hpp
==============================================================================
--- trunk/boost/asio/detail/win_static_mutex.hpp (original)
+++ trunk/boost/asio/detail/win_static_mutex.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 #include <boost/asio/detail/scoped_lock.hpp>
 
@@ -71,6 +71,6 @@
 # include <boost/asio/detail/impl/win_static_mutex.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_WIN_STATIC_MUTEX_HPP

Modified: trunk/boost/asio/detail/win_thread.hpp
==============================================================================
--- trunk/boost/asio/detail/win_thread.hpp (original)
+++ trunk/boost/asio/detail/win_thread.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/socket_types.hpp>
@@ -136,6 +136,6 @@
 # include <boost/asio/detail/impl/win_thread.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 
 #endif // BOOST_ASIO_DETAIL_WIN_THREAD_HPP

Modified: trunk/boost/asio/detail/win_tss_ptr.hpp
==============================================================================
--- trunk/boost/asio/detail/win_tss_ptr.hpp (original)
+++ trunk/boost/asio/detail/win_tss_ptr.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/socket_types.hpp>
@@ -76,6 +76,6 @@
 # include <boost/asio/detail/impl/win_tss_ptr.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_WIN_TSS_PTR_HPP

Modified: trunk/boost/asio/detail/wince_thread.hpp
==============================================================================
--- trunk/boost/asio/detail/wince_thread.hpp (original)
+++ trunk/boost/asio/detail/wince_thread.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
 #include <memory>
 #include <boost/asio/detail/noncopyable.hpp>
@@ -113,6 +113,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
 #endif // BOOST_ASIO_DETAIL_WINCE_THREAD_HPP

Modified: trunk/boost/asio/detail/winsock_init.hpp
==============================================================================
--- trunk/boost/asio/detail/winsock_init.hpp (original)
+++ trunk/boost/asio/detail/winsock_init.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -87,6 +87,6 @@
 # include <boost/asio/detail/impl/winsock_init.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_WINSOCK_INIT_HPP

Modified: trunk/boost/asio/error.hpp
==============================================================================
--- trunk/boost/asio/error.hpp (original)
+++ trunk/boost/asio/error.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,7 +18,7 @@
 #include <boost/asio/detail/config.hpp>
 #include <boost/cerrno.hpp>
 #include <boost/system/error_code.hpp>
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # include <winerror.h>
 #else
 # include <cerrno>
@@ -36,7 +36,7 @@
 # define BOOST_ASIO_GETADDRINFO_ERROR(e) implementation_defined
 /// INTERNAL ONLY.
 # define BOOST_ASIO_WIN_OR_POSIX(e_win, e_posix) implementation_defined
-#elif defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#elif defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # define BOOST_ASIO_NATIVE_ERROR(e) e
 # define BOOST_ASIO_SOCKET_ERROR(e) WSA ## e
 # define BOOST_ASIO_NETDB_ERROR(e) WSA ## e
@@ -216,7 +216,7 @@
   return boost::system::system_category();
 }
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 extern BOOST_ASIO_DECL
 const boost::system::error_category& get_netdb_category();
@@ -224,7 +224,7 @@
 extern BOOST_ASIO_DECL
 const boost::system::error_category& get_addrinfo_category();
 
-#else // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#else // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 inline const boost::system::error_category& get_netdb_category()
 {
@@ -236,7 +236,7 @@
   return get_system_category();
 }
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 extern BOOST_ASIO_DECL
 const boost::system::error_category& get_misc_category();

Modified: trunk/boost/asio/impl/error.ipp
==============================================================================
--- trunk/boost/asio/impl/error.ipp (original)
+++ trunk/boost/asio/impl/error.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -24,7 +24,7 @@
 namespace asio {
 namespace error {
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 namespace detail {
 
@@ -86,7 +86,7 @@
   return instance;
 }
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 namespace detail {
 

Modified: trunk/boost/asio/impl/io_service.ipp
==============================================================================
--- trunk/boost/asio/impl/io_service.ipp (original)
+++ trunk/boost/asio/impl/io_service.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,8 +16,8 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/limits.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/scoped_ptr.hpp>
 #include <boost/asio/detail/service_registry.hpp>
 #include <boost/asio/detail/throw_error.hpp>

Modified: trunk/boost/asio/impl/read.hpp
==============================================================================
--- trunk/boost/asio/impl/read.hpp (original)
+++ trunk/boost/asio/impl/read.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -84,7 +84,7 @@
   return bytes_transferred;
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 template <typename SyncReadStream, typename Allocator,
     typename CompletionCondition>
@@ -139,7 +139,7 @@
   return bytes_transferred;
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -564,7 +564,7 @@
   return init.result.get();
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -745,7 +745,7 @@
   return init.result.get();
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace asio
 } // namespace boost

Modified: trunk/boost/asio/impl/read_at.hpp
==============================================================================
--- trunk/boost/asio/impl/read_at.hpp (original)
+++ trunk/boost/asio/impl/read_at.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -38,7 +38,7 @@
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
     typename CompletionCondition>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition, boost::system::error_code& ec)
 {
   ec = boost::system::error_code();
@@ -61,7 +61,7 @@
 
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
 inline std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers)
+ uint64_t offset, const MutableBufferSequence& buffers)
 {
   boost::system::error_code ec;
   std::size_t bytes_transferred = read_at(
@@ -72,7 +72,7 @@
 
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
 inline std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
     boost::system::error_code& ec)
 {
   return read_at(d, offset, buffers, transfer_all(), ec);
@@ -81,7 +81,7 @@
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
     typename CompletionCondition>
 inline std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition)
 {
   boost::system::error_code ec;
@@ -91,12 +91,12 @@
   return bytes_transferred;
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 template <typename SyncRandomAccessReadDevice, typename Allocator,
     typename CompletionCondition>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition, boost::system::error_code& ec)
 {
   ec = boost::system::error_code();
@@ -119,7 +119,7 @@
 
 template <typename SyncRandomAccessReadDevice, typename Allocator>
 inline std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b)
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b)
 {
   boost::system::error_code ec;
   std::size_t bytes_transferred = read_at(
@@ -130,7 +130,7 @@
 
 template <typename SyncRandomAccessReadDevice, typename Allocator>
 inline std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     boost::system::error_code& ec)
 {
   return read_at(d, offset, b, transfer_all(), ec);
@@ -139,7 +139,7 @@
 template <typename SyncRandomAccessReadDevice, typename Allocator,
     typename CompletionCondition>
 inline std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition)
 {
   boost::system::error_code ec;
@@ -149,7 +149,7 @@
   return bytes_transferred;
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -161,7 +161,7 @@
   {
   public:
     read_at_op(AsyncRandomAccessReadDevice& device,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
         CompletionCondition completion_condition, ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
@@ -224,7 +224,7 @@
 
   //private:
     AsyncRandomAccessReadDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::asio::detail::consuming_buffers<
       mutable_buffer, MutableBufferSequence> buffers_;
     int start_;
@@ -240,7 +240,7 @@
   {
   public:
     read_at_op(AsyncRandomAccessReadDevice& device,
- boost::uint64_t offset, const boost::asio::mutable_buffers_1& buffers,
+ uint64_t offset, const boost::asio::mutable_buffers_1& buffers,
         CompletionCondition completion_condition, ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
@@ -304,7 +304,7 @@
 
   //private:
     AsyncRandomAccessReadDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::asio::mutable_buffer buffer_;
     int start_;
     std::size_t total_transferred_;
@@ -319,7 +319,7 @@
   {
   public:
     read_at_op(AsyncRandomAccessReadDevice& device,
- boost::uint64_t offset, const boost::array<Elem, 2>& buffers,
+ uint64_t offset, const boost::array<Elem, 2>& buffers,
         CompletionCondition completion_condition, ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
@@ -393,7 +393,7 @@
 
   //private:
     AsyncRandomAccessReadDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::array<Elem, 2> buffers_;
     int start_;
     std::size_t total_transferred_;
@@ -410,7 +410,7 @@
   {
   public:
     read_at_op(AsyncRandomAccessReadDevice& device,
- boost::uint64_t offset, const std::array<Elem, 2>& buffers,
+ uint64_t offset, const std::array<Elem, 2>& buffers,
         CompletionCondition completion_condition, ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
@@ -484,7 +484,7 @@
 
   //private:
     AsyncRandomAccessReadDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     std::array<Elem, 2> buffers_;
     int start_;
     std::size_t total_transferred_;
@@ -555,7 +555,7 @@
   inline read_at_op<AsyncRandomAccessReadDevice,
       MutableBufferSequence, CompletionCondition, ReadHandler>
   make_read_at_op(AsyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
       CompletionCondition completion_condition, ReadHandler handler)
   {
     return read_at_op<AsyncRandomAccessReadDevice,
@@ -569,7 +569,7 @@
 inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
     void (boost::system::error_code, std::size_t))
 async_read_at(AsyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
 {
@@ -595,7 +595,7 @@
 inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
     void (boost::system::error_code, std::size_t))
 async_read_at(AsyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
 {
   // If you get an error on the following line it means that your handler does
@@ -615,7 +615,7 @@
   return init.result.get();
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -626,7 +626,7 @@
   {
   public:
     read_at_streambuf_op(AsyncRandomAccessReadDevice& device,
- boost::uint64_t offset, basic_streambuf<Allocator>& streambuf,
+ uint64_t offset, basic_streambuf<Allocator>& streambuf,
         CompletionCondition completion_condition, ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
@@ -692,7 +692,7 @@
 
   //private:
     AsyncRandomAccessReadDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::asio::basic_streambuf<Allocator>& streambuf_;
     int start_;
     std::size_t total_transferred_;
@@ -756,7 +756,7 @@
 inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
     void (boost::system::error_code, std::size_t))
 async_read_at(AsyncRandomAccessReadDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
 {
@@ -782,7 +782,7 @@
 inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
     void (boost::system::error_code, std::size_t))
 async_read_at(AsyncRandomAccessReadDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
 {
   // If you get an error on the following line it means that your handler does
@@ -802,7 +802,7 @@
   return init.result.get();
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace asio
 } // namespace boost

Modified: trunk/boost/asio/impl/read_until.hpp
==============================================================================
--- trunk/boost/asio/impl/read_until.hpp (original)
+++ trunk/boost/asio/impl/read_until.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,7 +19,6 @@
 #include <string>
 #include <vector>
 #include <utility>
-#include <boost/limits.hpp>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/buffers_iterator.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
@@ -27,6 +26,7 @@
 #include <boost/asio/detail/handler_cont_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
 #include <boost/asio/detail/handler_type_requirements.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -190,6 +190,8 @@
   }
 }
 
+#if defined(BOOST_ASIO_HAS_BOOST_REGEX)
+
 template <typename SyncReadStream, typename Allocator>
 inline std::size_t read_until(SyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b, const boost::regex& expr)
@@ -257,11 +259,13 @@
   }
 }
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
+
 template <typename SyncReadStream, typename Allocator, typename MatchCondition>
 std::size_t read_until(SyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b,
     MatchCondition match_condition, boost::system::error_code& ec,
- typename boost::enable_if<is_match_condition<MatchCondition> >::type*)
+ typename enable_if<is_match_condition<MatchCondition>::value>::type*)
 {
   std::size_t search_position = 0;
   for (;;)
@@ -312,7 +316,7 @@
 template <typename SyncReadStream, typename Allocator, typename MatchCondition>
 inline std::size_t read_until(SyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b, MatchCondition match_condition,
- typename boost::enable_if<is_match_condition<MatchCondition> >::type*)
+ typename enable_if<is_match_condition<MatchCondition>::value>::type*)
 {
   boost::system::error_code ec;
   std::size_t bytes_transferred = read_until(s, b, match_condition, ec);
@@ -715,6 +719,8 @@
   return init.result.get();
 }
 
+#if defined(BOOST_ASIO_HAS_BOOST_REGEX)
+
 namespace detail
 {
   template <typename AsyncReadStream, typename Allocator,
@@ -925,6 +931,8 @@
   return init.result.get();
 }
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
+
 namespace detail
 {
   template <typename AsyncReadStream, typename Allocator,
@@ -1114,7 +1122,7 @@
 async_read_until(AsyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b,
     MatchCondition match_condition, BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
- typename boost::enable_if<is_match_condition<MatchCondition> >::type*)
+ typename enable_if<is_match_condition<MatchCondition>::value>::type*)
 {
   // If you get an error on the following line it means that your handler does
   // not meet the documented type requirements for a ReadHandler.

Modified: trunk/boost/asio/impl/serial_port_base.ipp
==============================================================================
--- trunk/boost/asio/impl/serial_port_base.ipp (original)
+++ trunk/boost/asio/impl/serial_port_base.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -21,13 +21,13 @@
 #if defined(BOOST_ASIO_HAS_SERIAL_PORT)
 
 #include <stdexcept>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/serial_port_base.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 
 #if defined(GENERATING_DOCUMENTATION)
 # define BOOST_ASIO_OPTION_STORAGE implementation_defined
-#elif defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#elif defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # define BOOST_ASIO_OPTION_STORAGE DCB
 #else
 # define BOOST_ASIO_OPTION_STORAGE termios
@@ -41,7 +41,7 @@
 boost::system::error_code serial_port_base::baud_rate::store(
     BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec) const
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   storage.BaudRate = value_;
 #else
   speed_t baud;
@@ -129,7 +129,7 @@
 boost::system::error_code serial_port_base::baud_rate::load(
     const BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   value_ = storage.BaudRate;
 #else
   speed_t baud = ::cfgetospeed(&storage);
@@ -215,14 +215,14 @@
   if (t != none && t != software && t != hardware)
   {
     std::out_of_range ex("invalid flow_control value");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
 }
 
 boost::system::error_code serial_port_base::flow_control::store(
     BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec) const
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   storage.fOutxCtsFlow = FALSE;
   storage.fOutxDsrFlow = FALSE;
   storage.fTXContinueOnXoff = TRUE;
@@ -289,7 +289,7 @@
 boost::system::error_code serial_port_base::flow_control::load(
     const BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   if (storage.fOutX && storage.fInX)
   {
     value_ = software;
@@ -333,14 +333,14 @@
   if (t != none && t != odd && t != even)
   {
     std::out_of_range ex("invalid parity value");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
 }
 
 boost::system::error_code serial_port_base::parity::store(
     BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec) const
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   switch (value_)
   {
   case none:
@@ -387,7 +387,7 @@
 boost::system::error_code serial_port_base::parity::load(
     const BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   if (storage.Parity == EVENPARITY)
   {
     value_ = even;
@@ -428,14 +428,14 @@
   if (t != one && t != onepointfive && t != two)
   {
     std::out_of_range ex("invalid stop_bits value");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
 }
 
 boost::system::error_code serial_port_base::stop_bits::store(
     BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec) const
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   switch (value_)
   {
   case one:
@@ -471,7 +471,7 @@
 boost::system::error_code serial_port_base::stop_bits::load(
     const BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   if (storage.StopBits == ONESTOPBIT)
   {
     value_ = one;
@@ -501,14 +501,14 @@
   if (t < 5 || t > 8)
   {
     std::out_of_range ex("invalid character_size value");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
 }
 
 boost::system::error_code serial_port_base::character_size::store(
     BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec) const
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   storage.ByteSize = value_;
 #else
   storage.c_cflag &= ~CSIZE;
@@ -528,7 +528,7 @@
 boost::system::error_code serial_port_base::character_size::load(
     const BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   value_ = storage.ByteSize;
 #else
   if ((storage.c_cflag & CSIZE) == CS5) { value_ = 5; }

Modified: trunk/boost/asio/impl/write.hpp
==============================================================================
--- trunk/boost/asio/impl/write.hpp (original)
+++ trunk/boost/asio/impl/write.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -82,7 +82,7 @@
   return bytes_transferred;
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 template <typename SyncWriteStream, typename Allocator,
     typename CompletionCondition>
@@ -125,7 +125,7 @@
   return bytes_transferred;
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -627,7 +627,7 @@
   return init.result.get();
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -757,7 +757,7 @@
   return init.result.get();
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace asio
 } // namespace boost

Modified: trunk/boost/asio/impl/write_at.hpp
==============================================================================
--- trunk/boost/asio/impl/write_at.hpp (original)
+++ trunk/boost/asio/impl/write_at.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -36,7 +36,7 @@
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence,
     typename CompletionCondition>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition, boost::system::error_code& ec)
 {
   ec = boost::system::error_code();
@@ -59,7 +59,7 @@
 
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence>
 inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers)
+ uint64_t offset, const ConstBufferSequence& buffers)
 {
   boost::system::error_code ec;
   std::size_t bytes_transferred = write_at(
@@ -70,7 +70,7 @@
 
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence>
 inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
     boost::system::error_code& ec)
 {
   return write_at(d, offset, buffers, transfer_all(), ec);
@@ -79,7 +79,7 @@
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence,
     typename CompletionCondition>
 inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition)
 {
   boost::system::error_code ec;
@@ -89,12 +89,12 @@
   return bytes_transferred;
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 template <typename SyncRandomAccessWriteDevice, typename Allocator,
     typename CompletionCondition>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition, boost::system::error_code& ec)
 {
   std::size_t bytes_transferred = write_at(
@@ -105,7 +105,7 @@
 
 template <typename SyncRandomAccessWriteDevice, typename Allocator>
 inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b)
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b)
 {
   boost::system::error_code ec;
   std::size_t bytes_transferred = write_at(d, offset, b, transfer_all(), ec);
@@ -115,7 +115,7 @@
 
 template <typename SyncRandomAccessWriteDevice, typename Allocator>
 inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     boost::system::error_code& ec)
 {
   return write_at(d, offset, b, transfer_all(), ec);
@@ -124,7 +124,7 @@
 template <typename SyncRandomAccessWriteDevice, typename Allocator,
     typename CompletionCondition>
 inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition)
 {
   boost::system::error_code ec;
@@ -134,7 +134,7 @@
   return bytes_transferred;
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -145,7 +145,7 @@
   {
   public:
     write_at_op(AsyncRandomAccessWriteDevice& device,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
         CompletionCondition completion_condition, WriteHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
@@ -209,7 +209,7 @@
 
   //private:
     AsyncRandomAccessWriteDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::asio::detail::consuming_buffers<
       const_buffer, ConstBufferSequence> buffers_;
     int start_;
@@ -225,7 +225,7 @@
   {
   public:
     write_at_op(AsyncRandomAccessWriteDevice& device,
- boost::uint64_t offset, const boost::asio::mutable_buffers_1& buffers,
+ uint64_t offset, const boost::asio::mutable_buffers_1& buffers,
         CompletionCondition completion_condition,
         WriteHandler& handler)
       : detail::base_from_completion_cond<
@@ -290,7 +290,7 @@
 
   //private:
     AsyncRandomAccessWriteDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::asio::mutable_buffer buffer_;
     int start_;
     std::size_t total_transferred_;
@@ -305,7 +305,7 @@
   {
   public:
     write_at_op(AsyncRandomAccessWriteDevice& device,
- boost::uint64_t offset, const boost::asio::const_buffers_1& buffers,
+ uint64_t offset, const boost::asio::const_buffers_1& buffers,
         CompletionCondition completion_condition,
         WriteHandler& handler)
       : detail::base_from_completion_cond<
@@ -370,7 +370,7 @@
 
   //private:
     AsyncRandomAccessWriteDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::asio::const_buffer buffer_;
     int start_;
     std::size_t total_transferred_;
@@ -385,7 +385,7 @@
   {
   public:
     write_at_op(AsyncRandomAccessWriteDevice& device,
- boost::uint64_t offset, const boost::array<Elem, 2>& buffers,
+ uint64_t offset, const boost::array<Elem, 2>& buffers,
         CompletionCondition completion_condition, WriteHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
@@ -459,7 +459,7 @@
 
   //private:
     AsyncRandomAccessWriteDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::array<Elem, 2> buffers_;
     int start_;
     std::size_t total_transferred_;
@@ -476,7 +476,7 @@
   {
   public:
     write_at_op(AsyncRandomAccessWriteDevice& device,
- boost::uint64_t offset, const std::array<Elem, 2>& buffers,
+ uint64_t offset, const std::array<Elem, 2>& buffers,
         CompletionCondition completion_condition, WriteHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
@@ -550,7 +550,7 @@
 
   //private:
     AsyncRandomAccessWriteDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     std::array<Elem, 2> buffers_;
     int start_;
     std::size_t total_transferred_;
@@ -617,7 +617,7 @@
   inline write_at_op<AsyncRandomAccessWriteDevice,
       ConstBufferSequence, CompletionCondition, WriteHandler>
   make_write_at_op(AsyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
       CompletionCondition completion_condition, WriteHandler handler)
   {
     return write_at_op<AsyncRandomAccessWriteDevice,
@@ -631,7 +631,7 @@
 inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
     void (boost::system::error_code, std::size_t))
 async_write_at(AsyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
 {
@@ -657,7 +657,7 @@
 inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
     void (boost::system::error_code, std::size_t))
 async_write_at(AsyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
 {
   // If you get an error on the following line it means that your handler does
@@ -677,7 +677,7 @@
   return init.result.get();
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -773,7 +773,7 @@
 inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
     void (boost::system::error_code, std::size_t))
 async_write_at(AsyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
 {
@@ -798,7 +798,7 @@
 inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
     void (boost::system::error_code, std::size_t))
 async_write_at(AsyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
 {
   // If you get an error on the following line it means that your handler does
@@ -817,7 +817,7 @@
   return init.result.get();
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace asio
 } // namespace boost

Modified: trunk/boost/asio/io_service.hpp
==============================================================================
--- trunk/boost/asio/io_service.hpp (original)
+++ trunk/boost/asio/io_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -31,7 +31,7 @@
 # include <boost/asio/detail/task_io_service_fwd.hpp>
 #endif
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # include <boost/asio/detail/winsock_init.hpp>
 #elif defined(__sun) || defined(__QNX__) || defined(__hpux) || defined(_AIX) \
   || defined(__osf__)
@@ -603,7 +603,7 @@
   friend bool has_service(io_service& ios);
 
 private:
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   detail::winsock_init<> init_;
 #elif defined(__sun) || defined(__QNX__) || defined(__hpux) || defined(_AIX) \
   || defined(__osf__)

Modified: trunk/boost/asio/ip/address.hpp
==============================================================================
--- trunk/boost/asio/ip/address.hpp (original)
+++ trunk/boost/asio/ip/address.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -21,9 +21,9 @@
 #include <boost/asio/ip/address_v4.hpp>
 #include <boost/asio/ip/address_v6.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 # include <iosfwd>
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -168,7 +168,7 @@
   boost::asio::ip::address_v6 ipv6_address_;
 };
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Output an address as a string.
 /**
@@ -186,7 +186,7 @@
 std::basic_ostream<Elem, Traits>& operator<<(
     std::basic_ostream<Elem, Traits>& os, const address& addr);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace ip
 } // namespace asio

Modified: trunk/boost/asio/ip/address_v4.hpp
==============================================================================
--- trunk/boost/asio/ip/address_v4.hpp (original)
+++ trunk/boost/asio/ip/address_v4.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -22,9 +22,9 @@
 #include <boost/asio/detail/winsock_init.hpp>
 #include <boost/system/error_code.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 # include <iosfwd>
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -209,7 +209,7 @@
   boost::asio::detail::in4_addr_type addr_;
 };
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Output an address as a string.
 /**
@@ -227,7 +227,7 @@
 std::basic_ostream<Elem, Traits>& operator<<(
     std::basic_ostream<Elem, Traits>& os, const address_v4& addr);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace ip
 } // namespace asio

Modified: trunk/boost/asio/ip/address_v6.hpp
==============================================================================
--- trunk/boost/asio/ip/address_v6.hpp (original)
+++ trunk/boost/asio/ip/address_v6.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -23,9 +23,9 @@
 #include <boost/system/error_code.hpp>
 #include <boost/asio/ip/address_v4.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 # include <iosfwd>
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -214,7 +214,7 @@
   unsigned long scope_id_;
 };
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Output an address as a string.
 /**
@@ -232,7 +232,7 @@
 std::basic_ostream<Elem, Traits>& operator<<(
     std::basic_ostream<Elem, Traits>& os, const address_v6& addr);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace ip
 } // namespace asio

Modified: trunk/boost/asio/ip/basic_endpoint.hpp
==============================================================================
--- trunk/boost/asio/ip/basic_endpoint.hpp (original)
+++ trunk/boost/asio/ip/basic_endpoint.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,9 +19,9 @@
 #include <boost/asio/ip/address.hpp>
 #include <boost/asio/ip/detail/endpoint.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 # include <iosfwd>
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -233,7 +233,7 @@
   boost::asio::ip::detail::endpoint impl_;
 };
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Output an endpoint as a string.
 /**
@@ -252,7 +252,7 @@
     std::basic_ostream<Elem, Traits>& os,
     const basic_endpoint<InternetProtocol>& endpoint);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace ip
 } // namespace asio

Modified: trunk/boost/asio/ip/detail/endpoint.hpp
==============================================================================
--- trunk/boost/asio/ip/detail/endpoint.hpp (original)
+++ trunk/boost/asio/ip/detail/endpoint.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -112,10 +112,10 @@
     return data_.base.sa_family == AF_INET;
   }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
   // Convert to a string.
   BOOST_ASIO_DECL std::string to_string(boost::system::error_code& ec) const;
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 private:
   // The underlying IP socket address.

Modified: trunk/boost/asio/ip/detail/impl/endpoint.ipp
==============================================================================
--- trunk/boost/asio/ip/detail/impl/endpoint.ipp (original)
+++ trunk/boost/asio/ip/detail/impl/endpoint.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,9 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstring>
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 # include <sstream>
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 #include <boost/asio/detail/socket_ops.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/error.hpp>
@@ -177,7 +177,7 @@
   return e1.port() < e2.port();
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 std::string endpoint::to_string(boost::system::error_code& ec) const
 {
   std::string a = address().to_string(ec);
@@ -194,7 +194,7 @@
 
   return tmp_os.str();
 }
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace detail
 } // namespace ip

Modified: trunk/boost/asio/ip/detail/socket_option.hpp
==============================================================================
--- trunk/boost/asio/ip/detail/socket_option.hpp (original)
+++ trunk/boost/asio/ip/detail/socket_option.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,9 +19,9 @@
 #include <cstddef>
 #include <cstring>
 #include <stdexcept>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/detail/socket_ops.hpp>
 #include <boost/asio/detail/socket_types.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 #include <boost/asio/ip/address.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -142,7 +142,7 @@
       if (s != sizeof(ipv6_value_))
       {
         std::length_error ex("multicast_enable_loopback socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
       }
       ipv4_value_ = ipv6_value_ ? 1 : 0;
     }
@@ -151,7 +151,7 @@
       if (s != sizeof(ipv4_value_))
       {
         std::length_error ex("multicast_enable_loopback socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
       }
       ipv6_value_ = ipv4_value_ ? 1 : 0;
     }
@@ -238,7 +238,7 @@
     if (s != sizeof(value_))
     {
       std::length_error ex("unicast hops socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
     }
 #if defined(__hpux)
     if (value_ < 0)
@@ -255,7 +255,7 @@
 class multicast_hops
 {
 public:
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   typedef int ipv4_value_type;
 #else
   typedef unsigned char ipv4_value_type;
@@ -275,7 +275,7 @@
     if (v < 0 || v > 255)
     {
       std::out_of_range ex("multicast hops value out of range");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
     }
     ipv4_value_ = (ipv4_value_type)v;
     ipv6_value_ = v;
@@ -287,7 +287,7 @@
     if (v < 0 || v > 255)
     {
       std::out_of_range ex("multicast hops value out of range");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
     }
     ipv4_value_ = (ipv4_value_type)v;
     ipv6_value_ = v;
@@ -354,7 +354,7 @@
       if (s != sizeof(ipv6_value_))
       {
         std::length_error ex("multicast hops socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
       }
       if (ipv6_value_ < 0)
         ipv4_value_ = 0;
@@ -368,7 +368,7 @@
       if (s != sizeof(ipv4_value_))
       {
         std::length_error ex("multicast hops socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
       }
       ipv6_value_ = ipv4_value_;
     }

Modified: trunk/boost/asio/ip/impl/address.hpp
==============================================================================
--- trunk/boost/asio/ip/impl/address.hpp (original)
+++ trunk/boost/asio/ip/impl/address.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -15,7 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/throw_error.hpp>
 
@@ -50,6 +50,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_IP_IMPL_ADDRESS_HPP

Modified: trunk/boost/asio/ip/impl/address.ipp
==============================================================================
--- trunk/boost/asio/ip/impl/address.ipp (original)
+++ trunk/boost/asio/ip/impl/address.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,8 +17,8 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <typeinfo>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/ip/address.hpp>
 #include <boost/system/system_error.hpp>
@@ -105,7 +105,7 @@
   if (type_ != ipv4)
   {
     std::bad_cast ex;
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
   return ipv4_address_;
 }
@@ -115,7 +115,7 @@
   if (type_ != ipv6)
   {
     std::bad_cast ex;
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
   return ipv6_address_;
 }

Modified: trunk/boost/asio/ip/impl/address_v4.hpp
==============================================================================
--- trunk/boost/asio/ip/impl/address_v4.hpp (original)
+++ trunk/boost/asio/ip/impl/address_v4.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -15,7 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/throw_error.hpp>
 
@@ -50,6 +50,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_IP_IMPL_ADDRESS_V4_HPP

Modified: trunk/boost/asio/ip/impl/address_v4.ipp
==============================================================================
--- trunk/boost/asio/ip/impl/address_v4.ipp (original)
+++ trunk/boost/asio/ip/impl/address_v4.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,10 +18,10 @@
 #include <boost/asio/detail/config.hpp>
 #include <climits>
 #include <stdexcept>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/detail/socket_ops.hpp>
 #include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 #include <boost/asio/ip/address_v4.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -37,7 +37,7 @@
       || bytes[2] > 0xFF || bytes[3] > 0xFF)
   {
     std::out_of_range ex("address_v4 from bytes_type");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
 #endif // UCHAR_MAX > 0xFF
 
@@ -51,7 +51,7 @@
   if (addr > 0xFFFFFFFF)
   {
     std::out_of_range ex("address_v4 from unsigned long");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
 #endif // ULONG_MAX > 0xFFFFFFFF
 

Modified: trunk/boost/asio/ip/impl/address_v6.hpp
==============================================================================
--- trunk/boost/asio/ip/impl/address_v6.hpp (original)
+++ trunk/boost/asio/ip/impl/address_v6.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -15,7 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/throw_error.hpp>
 
@@ -50,6 +50,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_IP_IMPL_ADDRESS_V6_HPP

Modified: trunk/boost/asio/ip/impl/address_v6.ipp
==============================================================================
--- trunk/boost/asio/ip/impl/address_v6.ipp (original)
+++ trunk/boost/asio/ip/impl/address_v6.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,9 +19,9 @@
 #include <cstring>
 #include <stdexcept>
 #include <typeinfo>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/detail/socket_ops.hpp>
 #include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/ip/address_v6.hpp>
 
@@ -47,7 +47,7 @@
     if (bytes[i] > 0xFF)
     {
       std::out_of_range ex("address_v6 from bytes_type");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
     }
   }
 #endif // UCHAR_MAX > 0xFF
@@ -151,7 +151,7 @@
   if (!is_v4_mapped() && !is_v4_compatible())
   {
     std::bad_cast ex;
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
 
   address_v4::bytes_type v4_bytes = { { addr_.s6_addr[12],

Modified: trunk/boost/asio/ip/impl/basic_endpoint.hpp
==============================================================================
--- trunk/boost/asio/ip/impl/basic_endpoint.hpp (original)
+++ trunk/boost/asio/ip/impl/basic_endpoint.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -15,7 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/throw_error.hpp>
 
@@ -52,6 +52,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_IP_IMPL_BASIC_ENDPOINT_HPP

Modified: trunk/boost/asio/ip/resolver_query_base.hpp
==============================================================================
--- trunk/boost/asio/ip/resolver_query_base.hpp (original)
+++ trunk/boost/asio/ip/resolver_query_base.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,6 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/detail/workaround.hpp>
 #include <boost/asio/detail/socket_types.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -140,12 +139,6 @@
   ~resolver_query_base()
   {
   }
-
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-private:
- // Workaround to enable the empty base optimisation with Borland C++.
- char dummy_;
-#endif
 };
 
 } // namespace ip

Modified: trunk/boost/asio/ip/tcp.hpp
==============================================================================
--- trunk/boost/asio/ip/tcp.hpp (original)
+++ trunk/boost/asio/ip/tcp.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -88,10 +88,10 @@
   /// The TCP resolver type.
   typedef basic_resolver<tcp> resolver;
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
   /// The TCP iostream type.
   typedef basic_socket_iostream<tcp> iostream;
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
   /// Socket option for disabling the Nagle algorithm.
   /**

Modified: trunk/boost/asio/is_read_buffered.hpp
==============================================================================
--- trunk/boost/asio/is_read_buffered.hpp (original)
+++ trunk/boost/asio/is_read_buffered.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -48,7 +48,7 @@
   /// read data.
   static const bool value;
 #else
- BOOST_STATIC_CONSTANT(bool,
+ BOOST_ASIO_STATIC_CONSTANT(bool,
       value = sizeof(detail::is_read_buffered_helper((Stream*)0)) == 1);
 #endif
 };

Modified: trunk/boost/asio/is_write_buffered.hpp
==============================================================================
--- trunk/boost/asio/is_write_buffered.hpp (original)
+++ trunk/boost/asio/is_write_buffered.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -48,7 +48,7 @@
   /// written data.
   static const bool value;
 #else
- BOOST_STATIC_CONSTANT(bool,
+ BOOST_ASIO_STATIC_CONSTANT(bool,
       value = sizeof(detail::is_write_buffered_helper((Stream*)0)) == 1);
 #endif
 };

Modified: trunk/boost/asio/local/basic_endpoint.hpp
==============================================================================
--- trunk/boost/asio/local/basic_endpoint.hpp (original)
+++ trunk/boost/asio/local/basic_endpoint.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -23,9 +23,9 @@
 
 #include <boost/asio/local/detail/endpoint.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 # include <iosfwd>
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/push_options.hpp>
 

Modified: trunk/boost/asio/local/stream_protocol.hpp
==============================================================================
--- trunk/boost/asio/local/stream_protocol.hpp (original)
+++ trunk/boost/asio/local/stream_protocol.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -74,10 +74,10 @@
   /// The UNIX domain acceptor type.
   typedef basic_socket_acceptor<stream_protocol> acceptor;
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
   /// The UNIX domain iostream type.
   typedef basic_socket_iostream<stream_protocol> iostream;
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 };
 
 } // namespace local

Modified: trunk/boost/asio/placeholders.hpp
==============================================================================
--- trunk/boost/asio/placeholders.hpp (original)
+++ trunk/boost/asio/placeholders.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,8 +16,10 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/bind/arg.hpp>
-#include <boost/detail/workaround.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind/arg.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -47,7 +49,8 @@
 /// boost::asio::signal_set::async_wait.
 unspecified signal_number;
 
-#elif defined(__BORLANDC__) || defined(__GNUC__)
+#elif defined(BOOST_ASIO_HAS_BOOST_BIND)
+# if defined(__BORLANDC__) || defined(__GNUC__)
 
 inline boost::arg<1> error()
 {
@@ -69,7 +72,7 @@
   return boost::arg<2>();
 }
 
-#else
+# else
 
 namespace detail
 {
@@ -84,7 +87,7 @@
   };
 }
 
-#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
+# if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC < 1400)
 
 static boost::arg<1>& error
   = boost::asio::placeholders::detail::placeholder<1>::get();
@@ -95,7 +98,7 @@
 static boost::arg<2>& signal_number
   = boost::asio::placeholders::detail::placeholder<2>::get();
 
-#else
+# else
 
 namespace
 {
@@ -109,8 +112,8 @@
     = boost::asio::placeholders::detail::placeholder<2>::get();
 } // namespace
 
-#endif
-
+# endif
+# endif
 #endif
 
 } // namespace placeholders

Modified: trunk/boost/asio/read.hpp
==============================================================================
--- trunk/boost/asio/read.hpp (original)
+++ trunk/boost/asio/read.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -208,7 +208,7 @@
 std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition, boost::system::error_code& ec);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Attempt to read a certain amount of data from a stream before returning.
 /**
@@ -350,7 +350,7 @@
 std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition, boost::system::error_code& ec);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 /**
@@ -499,7 +499,7 @@
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Start an asynchronous operation to read a certain amount of data from a
 /// stream.
@@ -619,7 +619,7 @@
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 

Modified: trunk/boost/asio/read_at.hpp
==============================================================================
--- trunk/boost/asio/read_at.hpp (original)
+++ trunk/boost/asio/read_at.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,9 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
-#include <boost/cstdint.hpp>
 #include <boost/asio/async_result.hpp>
 #include <boost/asio/basic_streambuf_fwd.hpp>
+#include <boost/asio/detail/cstdint.hpp>
 #include <boost/asio/error.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -77,7 +77,7 @@
  */
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers);
+ uint64_t offset, const MutableBufferSequence& buffers);
 
 /// Attempt to read a certain amount of data at the specified offset before
 /// returning.
@@ -122,7 +122,7 @@
  */
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
     boost::system::error_code& ec);
 
 /// Attempt to read a certain amount of data at the specified offset before
@@ -178,7 +178,7 @@
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
     typename CompletionCondition>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition);
 
 /// Attempt to read a certain amount of data at the specified offset before
@@ -227,10 +227,10 @@
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
     typename CompletionCondition>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition, boost::system::error_code& ec);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Attempt to read a certain amount of data at the specified offset before
 /// returning.
@@ -262,7 +262,7 @@
  */
 template <typename SyncRandomAccessReadDevice, typename Allocator>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, basic_streambuf<Allocator>& b);
+ uint64_t offset, basic_streambuf<Allocator>& b);
 
 /// Attempt to read a certain amount of data at the specified offset before
 /// returning.
@@ -294,7 +294,7 @@
  */
 template <typename SyncRandomAccessReadDevice, typename Allocator>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, basic_streambuf<Allocator>& b,
+ uint64_t offset, basic_streambuf<Allocator>& b,
     boost::system::error_code& ec);
 
 /// Attempt to read a certain amount of data at the specified offset before
@@ -337,7 +337,7 @@
 template <typename SyncRandomAccessReadDevice, typename Allocator,
     typename CompletionCondition>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, basic_streambuf<Allocator>& b,
+ uint64_t offset, basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition);
 
 /// Attempt to read a certain amount of data at the specified offset before
@@ -381,10 +381,10 @@
 template <typename SyncRandomAccessReadDevice, typename Allocator,
     typename CompletionCondition>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, basic_streambuf<Allocator>& b,
+ uint64_t offset, basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition, boost::system::error_code& ec);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 /**
@@ -458,7 +458,7 @@
     typename ReadHandler>
 BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
     void (boost::system::error_code, std::size_t))
-async_read_at(AsyncRandomAccessReadDevice& d, boost::uint64_t offset,
+async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset,
     const MutableBufferSequence& buffers,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
@@ -532,11 +532,11 @@
 BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
     void (boost::system::error_code, std::size_t))
 async_read_at(AsyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Start an asynchronous operation to read a certain amount of data at the
 /// specified offset.
@@ -587,7 +587,7 @@
     typename ReadHandler>
 BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
     void (boost::system::error_code, std::size_t))
-async_read_at(AsyncRandomAccessReadDevice& d, boost::uint64_t offset,
+async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset,
     basic_streambuf<Allocator>& b, BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
 /// Start an asynchronous operation to read a certain amount of data at the
@@ -648,11 +648,11 @@
 BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
     void (boost::system::error_code, std::size_t))
 async_read_at(AsyncRandomAccessReadDevice& d,
- boost::uint64_t offset, basic_streambuf<Allocator>& b,
+ uint64_t offset, basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 

Modified: trunk/boost/asio/read_until.hpp
==============================================================================
--- trunk/boost/asio/read_until.hpp (original)
+++ trunk/boost/asio/read_until.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,17 +17,14 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <cstddef>
-#include <boost/type_traits/is_function.hpp>
-#include <boost/type_traits/remove_pointer.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/detail/workaround.hpp>
 #include <string>
 #include <boost/asio/async_result.hpp>
 #include <boost/asio/basic_streambuf.hpp>
 #include <boost/asio/detail/regex_fwd.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -60,7 +57,8 @@
 #else
   enum
   {
- value = boost::is_function<typename boost::remove_pointer<T>::type>::value
+ value = boost::asio::is_function<
+ typename boost::asio::remove_pointer<T>::type>::value
       || detail::has_result_type<T>::value
   };
 #endif
@@ -248,6 +246,9 @@
     boost::asio::basic_streambuf<Allocator>& b, const std::string& delim,
     boost::system::error_code& ec);
 
+#if defined(BOOST_ASIO_HAS_BOOST_REGEX) \
+ || defined(GENERATING_DOCUMENTATION)
+
 /// Read data into a streambuf until some part of the data it contains matches
 /// a regular expression.
 /**
@@ -340,6 +341,9 @@
     boost::asio::basic_streambuf<Allocator>& b, const boost::regex& expr,
     boost::system::error_code& ec);
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
+ // || defined(GENERATING_DOCUMENTATION)
+
 /// Read data into a streambuf until a function object indicates a match.
 /**
  * This function is used to read data into the specified streambuf until a
@@ -442,7 +446,7 @@
 template <typename SyncReadStream, typename Allocator, typename MatchCondition>
 std::size_t read_until(SyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b, MatchCondition match_condition,
- typename boost::enable_if<is_match_condition<MatchCondition> >::type* = 0);
+ typename enable_if<is_match_condition<MatchCondition>::value>::type* = 0);
 
 /// Read data into a streambuf until a function object indicates a match.
 /**
@@ -498,7 +502,7 @@
 std::size_t read_until(SyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b,
     MatchCondition match_condition, boost::system::error_code& ec,
- typename boost::enable_if<is_match_condition<MatchCondition> >::type* = 0);
+ typename enable_if<is_match_condition<MatchCondition>::value>::type* = 0);
 
 /*@}*/
 /**
@@ -680,6 +684,9 @@
     boost::asio::basic_streambuf<Allocator>& b, const std::string& delim,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
+#if defined(BOOST_ASIO_HAS_BOOST_REGEX) \
+ || defined(GENERATING_DOCUMENTATION)
+
 /// Start an asynchronous operation to read data into a streambuf until some
 /// part of its data matches a regular expression.
 /**
@@ -769,6 +776,9 @@
     boost::asio::basic_streambuf<Allocator>& b, const boost::regex& expr,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
+ // || defined(GENERATING_DOCUMENTATION)
+
 /// Start an asynchronous operation to read data into a streambuf until a
 /// function object indicates a match.
 /**
@@ -899,7 +909,7 @@
 async_read_until(AsyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b,
     MatchCondition match_condition, BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
- typename boost::enable_if<is_match_condition<MatchCondition> >::type* = 0);
+ typename enable_if<is_match_condition<MatchCondition>::value>::type* = 0);
 
 /*@}*/
 
@@ -910,6 +920,6 @@
 
 #include <boost/asio/impl/read_until.hpp>
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_READ_UNTIL_HPP

Modified: trunk/boost/asio/serial_port_base.hpp
==============================================================================
--- trunk/boost/asio/serial_port_base.hpp (original)
+++ trunk/boost/asio/serial_port_base.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -21,17 +21,16 @@
 #if defined(BOOST_ASIO_HAS_SERIAL_PORT) \
   || defined(GENERATING_DOCUMENTATION)
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 # include <termios.h>
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
-#include <boost/detail/workaround.hpp>
 #include <boost/asio/detail/socket_types.hpp>
 #include <boost/system/error_code.hpp>
 
 #if defined(GENERATING_DOCUMENTATION)
 # define BOOST_ASIO_OPTION_STORAGE implementation_defined
-#elif defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#elif defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # define BOOST_ASIO_OPTION_STORAGE DCB
 #else
 # define BOOST_ASIO_OPTION_STORAGE termios
@@ -150,12 +149,6 @@
   ~serial_port_base()
   {
   }
-
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-private:
- // Workaround to enable the empty base optimisation with Borland C++.
- char dummy_;
-#endif
 };
 
 } // namespace asio

Modified: trunk/boost/asio/socket_base.hpp
==============================================================================
--- trunk/boost/asio/socket_base.hpp (original)
+++ trunk/boost/asio/socket_base.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,6 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/detail/workaround.hpp>
 #include <boost/asio/detail/io_control.hpp>
 #include <boost/asio/detail/socket_option.hpp>
 #include <boost/asio/detail/socket_types.hpp>
@@ -67,13 +66,13 @@
   /// Specifies that the data marks the end of a record.
   static const int message_end_of_record = implementation_defined;
 #else
- BOOST_STATIC_CONSTANT(int,
+ BOOST_ASIO_STATIC_CONSTANT(int,
       message_peek = boost::asio::detail::message_peek);
- BOOST_STATIC_CONSTANT(int,
+ BOOST_ASIO_STATIC_CONSTANT(int,
       message_out_of_band = boost::asio::detail::message_out_of_band);
- BOOST_STATIC_CONSTANT(int,
+ BOOST_ASIO_STATIC_CONSTANT(int,
       message_do_not_route = boost::asio::detail::message_do_not_route);
- BOOST_STATIC_CONSTANT(int,
+ BOOST_ASIO_STATIC_CONSTANT(int,
       message_end_of_record = boost::asio::detail::message_end_of_record);
 #endif
 
@@ -496,7 +495,7 @@
 #if defined(GENERATING_DOCUMENTATION)
   static const int max_connections = implementation_defined;
 #else
- BOOST_STATIC_CONSTANT(int, max_connections = SOMAXCONN);
+ BOOST_ASIO_STATIC_CONSTANT(int, max_connections = SOMAXCONN);
 #endif
 
 protected:
@@ -504,12 +503,6 @@
   ~socket_base()
   {
   }
-
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-private:
- // Workaround to enable the empty base optimisation with Borland C++.
- char dummy_;
-#endif
 };
 
 } // namespace asio

Modified: trunk/boost/asio/ssl/context_base.hpp
==============================================================================
--- trunk/boost/asio/ssl/context_base.hpp (original)
+++ trunk/boost/asio/ssl/context_base.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,6 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/detail/workaround.hpp>
 #include <boost/asio/ssl/detail/openssl_types.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -89,11 +88,11 @@
   /// Disable TLS v1.
   static const long no_tlsv1 = implementation_defined;
 #else
- BOOST_STATIC_CONSTANT(long, default_workarounds = SSL_OP_ALL);
- BOOST_STATIC_CONSTANT(long, single_dh_use = SSL_OP_SINGLE_DH_USE);
- BOOST_STATIC_CONSTANT(long, no_sslv2 = SSL_OP_NO_SSLv2);
- BOOST_STATIC_CONSTANT(long, no_sslv3 = SSL_OP_NO_SSLv3);
- BOOST_STATIC_CONSTANT(long, no_tlsv1 = SSL_OP_NO_TLSv1);
+ BOOST_ASIO_STATIC_CONSTANT(long, default_workarounds = SSL_OP_ALL);
+ BOOST_ASIO_STATIC_CONSTANT(long, single_dh_use = SSL_OP_SINGLE_DH_USE);
+ BOOST_ASIO_STATIC_CONSTANT(long, no_sslv2 = SSL_OP_NO_SSLv2);
+ BOOST_ASIO_STATIC_CONSTANT(long, no_sslv3 = SSL_OP_NO_SSLv3);
+ BOOST_ASIO_STATIC_CONSTANT(long, no_tlsv1 = SSL_OP_NO_TLSv1);
 #endif
 
   /// File format types.
@@ -111,11 +110,11 @@
   // New programs should use the equivalents of the same names that are defined
   // in the boost::asio::ssl namespace.
   typedef int verify_mode;
- BOOST_STATIC_CONSTANT(int, verify_none = SSL_VERIFY_NONE);
- BOOST_STATIC_CONSTANT(int, verify_peer = SSL_VERIFY_PEER);
- BOOST_STATIC_CONSTANT(int,
+ BOOST_ASIO_STATIC_CONSTANT(int, verify_none = SSL_VERIFY_NONE);
+ BOOST_ASIO_STATIC_CONSTANT(int, verify_peer = SSL_VERIFY_PEER);
+ BOOST_ASIO_STATIC_CONSTANT(int,
       verify_fail_if_no_peer_cert = SSL_VERIFY_FAIL_IF_NO_PEER_CERT);
- BOOST_STATIC_CONSTANT(int, verify_client_once = SSL_VERIFY_CLIENT_ONCE);
+ BOOST_ASIO_STATIC_CONSTANT(int, verify_client_once = SSL_VERIFY_CLIENT_ONCE);
 #endif
 
   /// Purpose of PEM password.
@@ -133,12 +132,6 @@
   ~context_base()
   {
   }
-
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-private:
- // Workaround to enable the empty base optimisation with Borland C++.
- char dummy_;
-#endif
 };
 
 } // namespace ssl

Modified: trunk/boost/asio/ssl/detail/impl/openssl_init.ipp
==============================================================================
--- trunk/boost/asio/ssl/detail/impl/openssl_init.ipp (original)
+++ trunk/boost/asio/ssl/detail/impl/openssl_init.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,7 +18,7 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <vector>
-#include <boost/assert.hpp>
+#include <boost/asio/detail/assert.hpp>
 #include <boost/asio/detail/mutex.hpp>
 #include <boost/asio/detail/tss_ptr.hpp>
 #include <boost/asio/ssl/detail/openssl_init.hpp>
@@ -64,15 +64,15 @@
 private:
   static unsigned long openssl_id_func()
   {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
     return ::GetCurrentThreadId();
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
     void* id = instance()->thread_id_;
     if (id == 0)
       instance()->thread_id_ = id = &id; // Ugh.
- BOOST_ASSERT(sizeof(unsigned long) >= sizeof(void*));
+ BOOST_ASIO_ASSERT(sizeof(unsigned long) >= sizeof(void*));
     return reinterpret_cast<unsigned long>(id);
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   }
 
   static void openssl_locking_func(int mode, int n,
@@ -88,10 +88,10 @@
   std::vector<boost::asio::detail::shared_ptr<
         boost::asio::detail::mutex> > mutexes_;
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   // The thread identifiers to be used by openssl.
   boost::asio::detail::tss_ptr<void> thread_id_;
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 };
 
 boost::asio::detail::shared_ptr<openssl_init_base::do_init>

Modified: trunk/boost/asio/ssl/detail/io.hpp
==============================================================================
--- trunk/boost/asio/ssl/detail/io.hpp (original)
+++ trunk/boost/asio/ssl/detail/io.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -152,10 +152,10 @@
           // cannot allow more than one read operation at a time on the
           // underlying transport. The pending_read_ timer's expiry is set to
           // pos_infin if a read is in progress, and neg_infin otherwise.
- if (core_.pending_read_.expires_at() == boost::posix_time::neg_infin)
+ if (core_.pending_read_.expires_at() == core_.neg_infin())
           {
             // Prevent other read operations from being started.
- core_.pending_read_.expires_at(boost::posix_time::pos_infin);
+ core_.pending_read_.expires_at(core_.pos_infin());
 
             // Start reading some data from the underlying transport.
             next_layer_.async_read_some(
@@ -179,10 +179,10 @@
           // cannot allow more than one write operation at a time on the
           // underlying transport. The pending_write_ timer's expiry is set to
           // pos_infin if a write is in progress, and neg_infin otherwise.
- if (core_.pending_write_.expires_at() == boost::posix_time::neg_infin)
+ if (core_.pending_write_.expires_at() == core_.neg_infin())
           {
             // Prevent other write operations from being started.
- core_.pending_write_.expires_at(boost::posix_time::pos_infin);
+ core_.pending_write_.expires_at(core_.pos_infin());
 
             // Start writing all the data to the underlying transport.
             boost::asio::async_write(next_layer_,
@@ -237,7 +237,7 @@
           core_.input_ = core_.engine_.put_input(core_.input_);
 
           // Release any waiting read operations.
- core_.pending_read_.expires_at(boost::posix_time::neg_infin);
+ core_.pending_read_.expires_at(core_.neg_infin());
 
           // Try the operation again.
           continue;
@@ -245,7 +245,7 @@
         case engine::want_output_and_retry:
 
           // Release any waiting write operations.
- core_.pending_write_.expires_at(boost::posix_time::neg_infin);
+ core_.pending_write_.expires_at(core_.neg_infin());
 
           // Try the operation again.
           continue;
@@ -253,7 +253,7 @@
         case engine::want_output:
 
           // Release any waiting write operations.
- core_.pending_write_.expires_at(boost::posix_time::neg_infin);
+ core_.pending_write_.expires_at(core_.neg_infin());
 
           // Fall through to call handler.
 

Modified: trunk/boost/asio/ssl/detail/stream_core.hpp
==============================================================================
--- trunk/boost/asio/ssl/detail/stream_core.hpp (original)
+++ trunk/boost/asio/ssl/detail/stream_core.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,7 +18,11 @@
 #include <boost/asio/detail/config.hpp>
 
 #if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
-# include <boost/asio/deadline_timer.hpp>
+# if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/deadline_timer.hpp>
+# else // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/steady_timer.hpp>
+# endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
 # include <boost/asio/ssl/detail/engine.hpp>
 # include <boost/asio/buffer.hpp>
 #endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
@@ -47,8 +51,8 @@
       input_buffer_space_(max_tls_record_size),
       input_buffer_(boost::asio::buffer(input_buffer_space_))
   {
- pending_read_.expires_at(boost::posix_time::neg_infin);
- pending_write_.expires_at(boost::posix_time::neg_infin);
+ pending_read_.expires_at(neg_infin());
+ pending_write_.expires_at(neg_infin());
   }
 
   ~stream_core()
@@ -58,12 +62,44 @@
   // The SSL engine.
   engine engine_;
 
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
   // Timer used for storing queued read operations.
   boost::asio::deadline_timer pending_read_;
 
   // Timer used for storing queued write operations.
   boost::asio::deadline_timer pending_write_;
 
+ // Helper function for obtaining a time value that always fires.
+ static boost::asio::deadline_timer::time_type neg_infin()
+ {
+ return boost::posix_time::neg_infin;
+ }
+
+ // Helper function for obtaining a time value that never fires.
+ static boost::asio::deadline_timer::time_type pos_infin()
+ {
+ return boost::posix_time::pos_infin;
+ }
+#else // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ // Timer used for storing queued read operations.
+ boost::asio::steady_timer pending_read_;
+
+ // Timer used for storing queued write operations.
+ boost::asio::steady_timer pending_write_;
+
+ // Helper function for obtaining a time value that always fires.
+ static boost::asio::steady_timer::time_point neg_infin()
+ {
+ return boost::asio::steady_timer::time_point::min();
+ }
+
+ // Helper function for obtaining a time value that never fires.
+ static boost::asio::steady_timer::time_point pos_infin()
+ {
+ return boost::asio::steady_timer::time_point::max();
+ }
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
   // Buffer space used to prepare output intended for the transport.
   std::vector<unsigned char> output_buffer_space_;
 

Modified: trunk/boost/asio/ssl/impl/context.ipp
==============================================================================
--- trunk/boost/asio/ssl/impl/context.ipp (original)
+++ trunk/boost/asio/ssl/impl/context.ipp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -512,12 +512,12 @@
     std::string passwd = callback->call(static_cast<std::size_t>(size),
         purpose ? context_base::for_writing : context_base::for_reading);
 
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_HAS_SECURE_RTL)
     strcpy_s(buf, size, passwd.c_str());
-#else
+#else // defined(BOOST_ASIO_HAS_SECURE_RTL)
     *buf = '\0';
     strncat(buf, passwd.c_str(), size);
-#endif
+#endif // defined(BOOST_ASIO_HAS_SECURE_RTL)
 
     return static_cast<int>(strlen(buf));
   }

Modified: trunk/boost/asio/ssl/old/detail/openssl_operation.hpp
==============================================================================
--- trunk/boost/asio/ssl/old/detail/openssl_operation.hpp (original)
+++ trunk/boost/asio/ssl/old/detail/openssl_operation.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,9 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <boost/function.hpp>
-#include <boost/assert.hpp>
 #include <boost/bind.hpp>
 #include <boost/asio/buffer.hpp>
+#include <boost/asio/detail/assert.hpp>
 #include <boost/asio/detail/socket_ops.hpp>
 #include <boost/asio/placeholders.hpp>
 #include <boost/asio/ssl/detail/openssl_types.hpp>
@@ -314,7 +314,7 @@
         unsigned char *data_start = send_buf_.get_unused_start();
         send_buf_.data_added(len);
  
- BOOST_ASSERT(strand_);
+ BOOST_ASIO_ASSERT(strand_);
         boost::asio::async_write
         (
           socket_,
@@ -379,7 +379,7 @@
   int do_async_read()
   {
     // Wait for new data
- BOOST_ASSERT(strand_);
+ BOOST_ASIO_ASSERT(strand_);
     socket_.async_read_some
     (
       boost::asio::buffer(recv_buf_.get_unused_start(),

Modified: trunk/boost/asio/ssl/old/stream.hpp
==============================================================================
--- trunk/boost/asio/ssl/old/stream.hpp (original)
+++ trunk/boost/asio/ssl/old/stream.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,8 +19,8 @@
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
 #include <boost/noncopyable.hpp>
-#include <boost/type_traits/remove_reference.hpp>
 #include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/ssl/basic_context.hpp>
 #include <boost/asio/ssl/stream_base.hpp>
@@ -60,7 +60,7 @@
 {
 public:
   /// The type of the next layer.
- typedef typename boost::remove_reference<Stream>::type next_layer_type;
+ typedef typename remove_reference<Stream>::type next_layer_type;
 
   /// The type of the lowest layer.
   typedef typename next_layer_type::lowest_layer_type lowest_layer_type;

Modified: trunk/boost/asio/ssl/stream.hpp
==============================================================================
--- trunk/boost/asio/ssl/stream.hpp (original)
+++ trunk/boost/asio/ssl/stream.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -24,6 +24,7 @@
 # include <boost/asio/detail/buffer_sequence_adapter.hpp>
 # include <boost/asio/detail/handler_type_requirements.hpp>
 # include <boost/asio/detail/noncopyable.hpp>
+# include <boost/asio/detail/type_traits.hpp>
 # include <boost/asio/ssl/context.hpp>
 # include <boost/asio/ssl/detail/handshake_op.hpp>
 # include <boost/asio/ssl/detail/io.hpp>
@@ -32,7 +33,6 @@
 # include <boost/asio/ssl/detail/stream_core.hpp>
 # include <boost/asio/ssl/detail/write_op.hpp>
 # include <boost/asio/ssl/stream_base.hpp>
-# include <boost/type_traits/remove_reference.hpp>
 #endif // defined(BOOST_ASIO_ENABLE_OLD_SSL)
 
 #include <boost/asio/detail/push_options.hpp>
@@ -88,7 +88,7 @@
   typedef impl_struct* impl_type;
 
   /// The type of the next layer.
- typedef typename boost::remove_reference<Stream>::type next_layer_type;
+ typedef typename remove_reference<Stream>::type next_layer_type;
 
   /// The type of the lowest layer.
   typedef typename next_layer_type::lowest_layer_type lowest_layer_type;

Modified: trunk/boost/asio/ssl/stream_base.hpp
==============================================================================
--- trunk/boost/asio/ssl/stream_base.hpp (original)
+++ trunk/boost/asio/ssl/stream_base.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,6 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/detail/workaround.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -44,12 +43,6 @@
   ~stream_base()
   {
   }
-
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-private:
- // Workaround to enable the empty base optimisation with Borland C++.
- char dummy_;
-#endif
 };
 
 } // namespace ssl

Modified: trunk/boost/asio/streambuf.hpp
==============================================================================
--- trunk/boost/asio/streambuf.hpp (original)
+++ trunk/boost/asio/streambuf.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/basic_streambuf.hpp>
 
@@ -30,6 +30,6 @@
 } // namespace asio
 } // namespace boost
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_STREAMBUF_HPP

Modified: trunk/boost/asio/time_traits.hpp
==============================================================================
--- trunk/boost/asio/time_traits.hpp (original)
+++ trunk/boost/asio/time_traits.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,6 +17,9 @@
 
 #include <boost/asio/detail/socket_types.hpp> // Must come before posix_time.
 
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \
+ || defined(GENERATING_DOCUMENTATION)
+
 #include <boost/asio/detail/push_options.hpp>
 #include <boost/date_time/posix_time/posix_time_types.hpp>
 #include <boost/asio/detail/pop_options.hpp>
@@ -81,4 +84,7 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ // || defined(GENERATING_DOCUMENTATION)
+
 #endif // BOOST_ASIO_TIME_TRAITS_HPP

Modified: trunk/boost/asio/windows/basic_random_access_handle.hpp
==============================================================================
--- trunk/boost/asio/windows/basic_random_access_handle.hpp (original)
+++ trunk/boost/asio/windows/basic_random_access_handle.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -156,7 +156,7 @@
    * std::vector.
    */
   template <typename ConstBufferSequence>
- std::size_t write_some_at(boost::uint64_t offset,
+ std::size_t write_some_at(uint64_t offset,
       const ConstBufferSequence& buffers)
   {
     boost::system::error_code ec;
@@ -185,7 +185,7 @@
    * all data is written before the blocking operation completes.
    */
   template <typename ConstBufferSequence>
- std::size_t write_some_at(boost::uint64_t offset,
+ std::size_t write_some_at(uint64_t offset,
       const ConstBufferSequence& buffers, boost::system::error_code& ec)
   {
     return this->get_service().write_some_at(
@@ -232,7 +232,7 @@
   template <typename ConstBufferSequence, typename WriteHandler>
   BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
       void (boost::system::error_code, std::size_t))
- async_write_some_at(boost::uint64_t offset,
+ async_write_some_at(uint64_t offset,
       const ConstBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
@@ -275,7 +275,7 @@
    * std::vector.
    */
   template <typename MutableBufferSequence>
- std::size_t read_some_at(boost::uint64_t offset,
+ std::size_t read_some_at(uint64_t offset,
       const MutableBufferSequence& buffers)
   {
     boost::system::error_code ec;
@@ -305,7 +305,7 @@
    * completes.
    */
   template <typename MutableBufferSequence>
- std::size_t read_some_at(boost::uint64_t offset,
+ std::size_t read_some_at(uint64_t offset,
       const MutableBufferSequence& buffers, boost::system::error_code& ec)
   {
     return this->get_service().read_some_at(
@@ -353,7 +353,7 @@
   template <typename MutableBufferSequence, typename ReadHandler>
   BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
       void (boost::system::error_code, std::size_t))
- async_read_some_at(boost::uint64_t offset,
+ async_read_some_at(uint64_t offset,
       const MutableBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {

Modified: trunk/boost/asio/windows/random_access_handle_service.hpp
==============================================================================
--- trunk/boost/asio/windows/random_access_handle_service.hpp (original)
+++ trunk/boost/asio/windows/random_access_handle_service.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -22,8 +22,8 @@
 
 #include <cstddef>
 #include <boost/config.hpp>
-#include <boost/cstdint.hpp>
 #include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/cstdint.hpp>
 #include <boost/asio/detail/win_iocp_handle_service.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
@@ -152,7 +152,7 @@
 
   /// Write the given data at the specified offset.
   template <typename ConstBufferSequence>
- std::size_t write_some_at(implementation_type& impl, boost::uint64_t offset,
+ std::size_t write_some_at(implementation_type& impl, uint64_t offset,
       const ConstBufferSequence& buffers, boost::system::error_code& ec)
   {
     return service_impl_.write_some_at(impl, offset, buffers, ec);
@@ -163,7 +163,7 @@
   BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
       void (boost::system::error_code, std::size_t))
   async_write_some_at(implementation_type& impl,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
     boost::asio::detail::async_result_init<
@@ -177,7 +177,7 @@
 
   /// Read some data from the specified offset.
   template <typename MutableBufferSequence>
- std::size_t read_some_at(implementation_type& impl, boost::uint64_t offset,
+ std::size_t read_some_at(implementation_type& impl, uint64_t offset,
       const MutableBufferSequence& buffers, boost::system::error_code& ec)
   {
     return service_impl_.read_some_at(impl, offset, buffers, ec);
@@ -188,7 +188,7 @@
   BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
       void (boost::system::error_code, std::size_t))
   async_read_some_at(implementation_type& impl,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
     boost::asio::detail::async_result_init<

Modified: trunk/boost/asio/write.hpp
==============================================================================
--- trunk/boost/asio/write.hpp (original)
+++ trunk/boost/asio/write.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -207,7 +207,7 @@
 std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition, boost::system::error_code& ec);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Write all of the supplied data to a stream before returning.
 /**
@@ -349,7 +349,7 @@
 std::size_t write(SyncWriteStream& s, basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition, boost::system::error_code& ec);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 /**
@@ -494,7 +494,7 @@
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Start an asynchronous operation to write all of the supplied data to a
 /// stream.
@@ -606,7 +606,7 @@
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 

Modified: trunk/boost/asio/write_at.hpp
==============================================================================
--- trunk/boost/asio/write_at.hpp (original)
+++ trunk/boost/asio/write_at.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,9 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
-#include <boost/cstdint.hpp>
 #include <boost/asio/async_result.hpp>
 #include <boost/asio/basic_streambuf_fwd.hpp>
+#include <boost/asio/detail/cstdint.hpp>
 #include <boost/asio/error.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -75,7 +75,7 @@
  */
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers);
+ uint64_t offset, const ConstBufferSequence& buffers);
 
 /// Write all of the supplied data at the specified offset before returning.
 /**
@@ -119,7 +119,7 @@
  */
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
     boost::system::error_code& ec);
 
 /// Write a certain amount of data at a specified offset before returning.
@@ -174,7 +174,7 @@
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence,
     typename CompletionCondition>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition);
 
 /// Write a certain amount of data at a specified offset before returning.
@@ -222,10 +222,10 @@
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence,
     typename CompletionCondition>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition, boost::system::error_code& ec);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Write all of the supplied data at the specified offset before returning.
 /**
@@ -258,7 +258,7 @@
  */
 template <typename SyncRandomAccessWriteDevice, typename Allocator>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, basic_streambuf<Allocator>& b);
+ uint64_t offset, basic_streambuf<Allocator>& b);
 
 /// Write all of the supplied data at the specified offset before returning.
 /**
@@ -291,7 +291,7 @@
  */
 template <typename SyncRandomAccessWriteDevice, typename Allocator>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, basic_streambuf<Allocator>& b,
+ uint64_t offset, basic_streambuf<Allocator>& b,
     boost::system::error_code& ec);
 
 /// Write a certain amount of data at a specified offset before returning.
@@ -334,7 +334,7 @@
  */
 template <typename SyncRandomAccessWriteDevice, typename Allocator,
     typename CompletionCondition>
-std::size_t write_at(SyncRandomAccessWriteDevice& d, boost::uint64_t offset,
+std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset,
     basic_streambuf<Allocator>& b, CompletionCondition completion_condition);
 
 /// Write a certain amount of data at a specified offset before returning.
@@ -378,11 +378,11 @@
  */
 template <typename SyncRandomAccessWriteDevice, typename Allocator,
     typename CompletionCondition>
-std::size_t write_at(SyncRandomAccessWriteDevice& d, boost::uint64_t offset,
+std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset,
     basic_streambuf<Allocator>& b, CompletionCondition completion_condition,
     boost::system::error_code& ec);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 /**
@@ -448,7 +448,7 @@
     typename WriteHandler>
 BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
     void (boost::system::error_code, std::size_t))
-async_write_at(AsyncRandomAccessWriteDevice& d, boost::uint64_t offset,
+async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
     const ConstBufferSequence& buffers,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler);
 
@@ -523,11 +523,11 @@
 BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
     void (boost::system::error_code, std::size_t))
 async_write_at(AsyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Start an asynchronous operation to write all of the supplied data at the
 /// specified offset.
@@ -573,7 +573,7 @@
     typename WriteHandler>
 BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
     void (boost::system::error_code, std::size_t))
-async_write_at(AsyncRandomAccessWriteDevice& d, boost::uint64_t offset,
+async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
     basic_streambuf<Allocator>& b, BOOST_ASIO_MOVE_ARG(WriteHandler) handler);
 
 /// Start an asynchronous operation to write a certain amount of data at the
@@ -634,11 +634,11 @@
     typename CompletionCondition, typename WriteHandler>
 BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
     void (boost::system::error_code, std::size_t))
-async_write_at(AsyncRandomAccessWriteDevice& d, boost::uint64_t offset,
+async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
     basic_streambuf<Allocator>& b, CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 

Modified: trunk/libs/asio/example/cpp03/icmp/ping.cpp
==============================================================================
--- trunk/libs/asio/example/cpp03/icmp/ping.cpp (original)
+++ trunk/libs/asio/example/cpp03/icmp/ping.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -121,7 +121,7 @@
 
   static unsigned short get_identifier()
   {
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
     return static_cast<unsigned short>(::GetCurrentProcessId());
 #else
     return static_cast<unsigned short>(::getpid());
@@ -145,7 +145,7 @@
     if (argc != 2)
     {
       std::cerr << "Usage: ping <host>" << std::endl;
-#if !defined(BOOST_WINDOWS)
+#if !defined(BOOST_ASIO_WINDOWS)
       std::cerr << "(You may need to run this program as root.)" << std::endl;
 #endif
       return 1;

Modified: trunk/libs/asio/test/basic_datagram_socket.cpp
==============================================================================
--- trunk/libs/asio/test/basic_datagram_socket.cpp (original)
+++ trunk/libs/asio/test/basic_datagram_socket.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_datagram_socket");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_datagram_socket",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/basic_deadline_timer.cpp
==============================================================================
--- trunk/libs/asio/test/basic_deadline_timer.cpp (original)
+++ trunk/libs/asio/test/basic_deadline_timer.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_deadline_timer");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_deadline_timer",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/basic_raw_socket.cpp
==============================================================================
--- trunk/libs/asio/test/basic_raw_socket.cpp (original)
+++ trunk/libs/asio/test/basic_raw_socket.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_raw_socket");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_raw_socket",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/basic_seq_packet_socket.cpp
==============================================================================
--- trunk/libs/asio/test/basic_seq_packet_socket.cpp (original)
+++ trunk/libs/asio/test/basic_seq_packet_socket.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_seq_packet_socket");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_seq_packet_socket",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/basic_serial_port.cpp
==============================================================================
--- trunk/libs/asio/test/basic_serial_port.cpp (original)
+++ trunk/libs/asio/test/basic_serial_port.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,9 +19,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_serial_port");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_serial_port",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/basic_signal_set.cpp
==============================================================================
--- trunk/libs/asio/test/basic_signal_set.cpp (original)
+++ trunk/libs/asio/test/basic_signal_set.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_signal_set");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_signal_set",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/basic_socket_acceptor.cpp
==============================================================================
--- trunk/libs/asio/test/basic_socket_acceptor.cpp (original)
+++ trunk/libs/asio/test/basic_socket_acceptor.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_socket_acceptor");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_socket_acceptor",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/basic_stream_socket.cpp
==============================================================================
--- trunk/libs/asio/test/basic_stream_socket.cpp (original)
+++ trunk/libs/asio/test/basic_stream_socket.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_stream_socket");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_stream_socket",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/basic_streambuf.cpp
==============================================================================
--- trunk/libs/asio/test/basic_streambuf.cpp (original)
+++ trunk/libs/asio/test/basic_streambuf.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_streambuf");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_streambuf",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/basic_waitable_timer.cpp
==============================================================================
--- trunk/libs/asio/test/basic_waitable_timer.cpp (original)
+++ trunk/libs/asio/test/basic_waitable_timer.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_waitable_timer");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_waitable_timer",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/buffer.cpp
==============================================================================
--- trunk/libs/asio/test/buffer.cpp (original)
+++ trunk/libs/asio/test/buffer.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,9 +16,16 @@
 // Test that header file is self-contained.
 #include <boost/asio/buffer.hpp>
 
-#include <boost/array.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+# include <boost/array.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+# include <array>
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
+
 //------------------------------------------------------------------------------
 
 // buffer_compile test
@@ -38,9 +45,11 @@
     const char const_raw_data[1024] = "";
     void* void_ptr_data = raw_data;
     const void* const_void_ptr_data = const_raw_data;
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
     boost::array<char, 1024> array_data;
     const boost::array<char, 1024>& const_array_data_1 = array_data;
     boost::array<const char, 1024> const_array_data_2 = { { 0 } };
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
     std::array<char, 1024> std_array_data;
     const std::array<char, 1024>& const_std_array_data_1 = std_array_data;
@@ -133,12 +142,14 @@
     mb1 = buffer(raw_data, 1024);
     cb1 = buffer(const_raw_data);
     cb1 = buffer(const_raw_data, 1024);
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
     mb1 = buffer(array_data);
     mb1 = buffer(array_data, 1024);
     cb1 = buffer(const_array_data_1);
     cb1 = buffer(const_array_data_1, 1024);
     cb1 = buffer(const_array_data_2);
     cb1 = buffer(const_array_data_2, 1024);
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
     mb1 = buffer(std_array_data);
     mb1 = buffer(std_array_data, 1024);
@@ -228,9 +239,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("buffer");
- test->add(BOOST_TEST_CASE(&buffer_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "buffer",
+ BOOST_ASIO_TEST_CASE(buffer_compile::test)
+)

Modified: trunk/libs/asio/test/buffered_read_stream.cpp
==============================================================================
--- trunk/libs/asio/test/buffered_read_stream.cpp (original)
+++ trunk/libs/asio/test/buffered_read_stream.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,15 +16,19 @@
 // Test that header file is self-contained.
 #include <boost/asio/buffered_read_stream.hpp>
 
-#include <boost/bind.hpp>
 #include <cstring>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/ip/tcp.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/system/system_error.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 typedef boost::asio::buffered_read_stream<
     boost::asio::ip::tcp::socket> stream_type;
 
@@ -66,9 +70,9 @@
         boost::asio::buffer(read_buf + bytes_read));
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   bytes_written = 0;
   while (bytes_written < sizeof(write_data))
@@ -84,31 +88,31 @@
         boost::asio::buffer(read_buf + bytes_read));
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   server_socket.close();
   boost::system::error_code error;
   bytes_read = client_socket.read_some(
       boost::asio::buffer(read_buf), error);
 
- BOOST_CHECK(bytes_read == 0);
- BOOST_CHECK(error == boost::asio::error::eof);
+ BOOST_ASIO_CHECK(bytes_read == 0);
+ BOOST_ASIO_CHECK(error == boost::asio::error::eof);
 
   client_socket.close(error);
 }
 
 void handle_accept(const boost::system::error_code& e)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
 }
 
 void handle_write(const boost::system::error_code& e,
     std::size_t bytes_transferred,
     std::size_t* total_bytes_written)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
   if (e)
     throw boost::system::system_error(e); // Terminate test.
   *total_bytes_written += bytes_transferred;
@@ -118,7 +122,7 @@
     std::size_t bytes_transferred,
     std::size_t* total_bytes_read)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
   if (e)
     throw boost::system::system_error(e); // Terminate test.
   *total_bytes_read += bytes_transferred;
@@ -127,14 +131,22 @@
 void handle_read_eof(const boost::system::error_code& e,
     std::size_t bytes_transferred)
 {
- BOOST_CHECK(e == boost::asio::error::eof);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(e == boost::asio::error::eof);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void test_async_operations()
 {
   using namespace std; // For memcmp.
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service io_service;
 
   boost::asio::ip::tcp::acceptor acceptor(io_service,
@@ -159,8 +171,7 @@
   {
     client_socket.async_write_some(
         boost::asio::buffer(write_buf + bytes_written),
- boost::bind(handle_write, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_written));
+ bindns::bind(handle_write, _1, _2, &bytes_written));
     io_service.run();
     io_service.reset();
   }
@@ -173,23 +184,21 @@
   {
     server_socket.async_read_some(
         boost::asio::buffer(read_buf + bytes_read),
- boost::bind(handle_read, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_read));
+ bindns::bind(handle_read, _1, _2, &bytes_read));
     io_service.run();
     io_service.reset();
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   bytes_written = 0;
   while (bytes_written < sizeof(write_data))
   {
     server_socket.async_write_some(
         boost::asio::buffer(write_buf + bytes_written),
- boost::bind(handle_write, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_written));
+ bindns::bind(handle_write, _1, _2, &bytes_written));
     io_service.run();
     io_service.reset();
   }
@@ -199,24 +208,22 @@
   {
     client_socket.async_read_some(
         boost::asio::buffer(read_buf + bytes_read),
- boost::bind(handle_read, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_read));
+ bindns::bind(handle_read, _1, _2, &bytes_read));
     io_service.run();
     io_service.reset();
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   server_socket.close();
   client_socket.async_read_some(boost::asio::buffer(read_buf), handle_read_eof);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("buffered_read_stream");
- test->add(BOOST_TEST_CASE(&test_sync_operations));
- test->add(BOOST_TEST_CASE(&test_async_operations));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "buffered_read_stream",
+ BOOST_ASIO_TEST_CASE(test_sync_operations)
+ BOOST_ASIO_TEST_CASE(test_async_operations)
+)

Modified: trunk/libs/asio/test/buffered_stream.cpp
==============================================================================
--- trunk/libs/asio/test/buffered_stream.cpp (original)
+++ trunk/libs/asio/test/buffered_stream.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,15 +16,19 @@
 // Test that header file is self-contained.
 #include <boost/asio/buffered_stream.hpp>
 
-#include <boost/bind.hpp>
 #include <cstring>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/ip/tcp.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/system/system_error.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 typedef boost::asio::buffered_stream<
     boost::asio::ip::tcp::socket> stream_type;
 
@@ -67,9 +71,9 @@
         boost::asio::buffer(read_buf + bytes_read));
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   bytes_written = 0;
   while (bytes_written < sizeof(write_data))
@@ -86,31 +90,31 @@
         boost::asio::buffer(read_buf + bytes_read));
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   server_socket.close();
   boost::system::error_code error;
   bytes_read = client_socket.read_some(
       boost::asio::buffer(read_buf), error);
 
- BOOST_CHECK(bytes_read == 0);
- BOOST_CHECK(error == boost::asio::error::eof);
+ BOOST_ASIO_CHECK(bytes_read == 0);
+ BOOST_ASIO_CHECK(error == boost::asio::error::eof);
 
   client_socket.close(error);
 }
 
 void handle_accept(const boost::system::error_code& e)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
 }
 
 void handle_write(const boost::system::error_code& e,
     std::size_t bytes_transferred,
     std::size_t* total_bytes_written)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
   if (e)
     throw boost::system::system_error(e); // Terminate test.
   *total_bytes_written += bytes_transferred;
@@ -118,14 +122,14 @@
 
 void handle_flush(const boost::system::error_code& e)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
 }
 
 void handle_read(const boost::system::error_code& e,
     std::size_t bytes_transferred,
     std::size_t* total_bytes_read)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
   if (e)
     throw boost::system::system_error(e); // Terminate test.
   *total_bytes_read += bytes_transferred;
@@ -134,14 +138,22 @@
 void handle_read_eof(const boost::system::error_code& e,
     std::size_t bytes_transferred)
 {
- BOOST_CHECK(e == boost::asio::error::eof);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(e == boost::asio::error::eof);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void test_async_operations()
 {
   using namespace std; // For memcmp.
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service io_service;
 
   boost::asio::ip::tcp::acceptor acceptor(io_service,
@@ -166,12 +178,11 @@
   {
     client_socket.async_write_some(
         boost::asio::buffer(write_buf + bytes_written),
- boost::bind(handle_write, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_written));
+ bindns::bind(handle_write, _1, _2, &bytes_written));
     io_service.run();
     io_service.reset();
     client_socket.async_flush(
- boost::bind(handle_flush, boost::asio::placeholders::error));
+ bindns::bind(handle_flush, _1));
     io_service.run();
     io_service.reset();
   }
@@ -184,27 +195,25 @@
   {
     server_socket.async_read_some(
         boost::asio::buffer(read_buf + bytes_read),
- boost::bind(handle_read, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_read));
+ bindns::bind(handle_read, _1, _2, &bytes_read));
     io_service.run();
     io_service.reset();
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   bytes_written = 0;
   while (bytes_written < sizeof(write_data))
   {
     server_socket.async_write_some(
         boost::asio::buffer(write_buf + bytes_written),
- boost::bind(handle_write, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_written));
+ bindns::bind(handle_write, _1, _2, &bytes_written));
     io_service.run();
     io_service.reset();
     server_socket.async_flush(
- boost::bind(handle_flush, boost::asio::placeholders::error));
+ bindns::bind(handle_flush, _1));
     io_service.run();
     io_service.reset();
   }
@@ -214,24 +223,22 @@
   {
     client_socket.async_read_some(
         boost::asio::buffer(read_buf + bytes_read),
- boost::bind(handle_read, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_read));
+ bindns::bind(handle_read, _1, _2, &bytes_read));
     io_service.run();
     io_service.reset();
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   server_socket.close();
   client_socket.async_read_some(boost::asio::buffer(read_buf), handle_read_eof);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("buffered_stream");
- test->add(BOOST_TEST_CASE(&test_sync_operations));
- test->add(BOOST_TEST_CASE(&test_async_operations));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "buffered_stream",
+ BOOST_ASIO_TEST_CASE(test_sync_operations)
+ BOOST_ASIO_TEST_CASE(test_async_operations)
+)

Modified: trunk/libs/asio/test/buffered_write_stream.cpp
==============================================================================
--- trunk/libs/asio/test/buffered_write_stream.cpp (original)
+++ trunk/libs/asio/test/buffered_write_stream.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,15 +16,19 @@
 // Test that header file is self-contained.
 #include <boost/asio/buffered_write_stream.hpp>
 
-#include <boost/bind.hpp>
 #include <cstring>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/ip/tcp.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/system/system_error.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 typedef boost::asio::buffered_write_stream<
     boost::asio::ip::tcp::socket> stream_type;
 
@@ -67,9 +71,9 @@
         boost::asio::buffer(read_buf + bytes_read));
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   bytes_written = 0;
   while (bytes_written < sizeof(write_data))
@@ -86,31 +90,31 @@
         boost::asio::buffer(read_buf + bytes_read));
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   server_socket.close();
   boost::system::error_code error;
   bytes_read = client_socket.read_some(
       boost::asio::buffer(read_buf), error);
 
- BOOST_CHECK(bytes_read == 0);
- BOOST_CHECK(error == boost::asio::error::eof);
+ BOOST_ASIO_CHECK(bytes_read == 0);
+ BOOST_ASIO_CHECK(error == boost::asio::error::eof);
 
   client_socket.close(error);
 }
 
 void handle_accept(const boost::system::error_code& e)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
 }
 
 void handle_write(const boost::system::error_code& e,
     std::size_t bytes_transferred,
     std::size_t* total_bytes_written)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
   if (e)
     throw boost::system::system_error(e); // Terminate test.
   *total_bytes_written += bytes_transferred;
@@ -118,14 +122,14 @@
 
 void handle_flush(const boost::system::error_code& e)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
 }
 
 void handle_read(const boost::system::error_code& e,
     std::size_t bytes_transferred,
     std::size_t* total_bytes_read)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
   if (e)
     throw boost::system::system_error(e); // Terminate test.
   *total_bytes_read += bytes_transferred;
@@ -134,14 +138,22 @@
 void handle_read_eof(const boost::system::error_code& e,
     std::size_t bytes_transferred)
 {
- BOOST_CHECK(e == boost::asio::error::eof);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(e == boost::asio::error::eof);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void test_async_operations()
 {
   using namespace std; // For memcmp.
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service io_service;
 
   boost::asio::ip::tcp::acceptor acceptor(io_service,
@@ -166,12 +178,11 @@
   {
     client_socket.async_write_some(
         boost::asio::buffer(write_buf + bytes_written),
- boost::bind(handle_write, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_written));
+ bindns::bind(handle_write, _1, _2, &bytes_written));
     io_service.run();
     io_service.reset();
     client_socket.async_flush(
- boost::bind(handle_flush, boost::asio::placeholders::error));
+ bindns::bind(handle_flush, _1));
     io_service.run();
     io_service.reset();
   }
@@ -184,27 +195,25 @@
   {
     server_socket.async_read_some(
         boost::asio::buffer(read_buf + bytes_read),
- boost::bind(handle_read, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_read));
+ bindns::bind(handle_read, _1, _2, &bytes_read));
     io_service.run();
     io_service.reset();
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   bytes_written = 0;
   while (bytes_written < sizeof(write_data))
   {
     server_socket.async_write_some(
         boost::asio::buffer(write_buf + bytes_written),
- boost::bind(handle_write, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_written));
+ bindns::bind(handle_write, _1, _2, &bytes_written));
     io_service.run();
     io_service.reset();
     server_socket.async_flush(
- boost::bind(handle_flush, boost::asio::placeholders::error));
+ bindns::bind(handle_flush, _1));
     io_service.run();
     io_service.reset();
   }
@@ -214,24 +223,22 @@
   {
     client_socket.async_read_some(
         boost::asio::buffer(read_buf + bytes_read),
- boost::bind(handle_read, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_read));
+ bindns::bind(handle_read, _1, _2, &bytes_read));
     io_service.run();
     io_service.reset();
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   server_socket.close();
   client_socket.async_read_some(boost::asio::buffer(read_buf), handle_read_eof);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("buffered_write_stream");
- test->add(BOOST_TEST_CASE(&test_sync_operations));
- test->add(BOOST_TEST_CASE(&test_async_operations));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "buffered_write_stream",
+ BOOST_ASIO_TEST_CASE(test_sync_operations)
+ BOOST_ASIO_TEST_CASE(test_async_operations)
+)

Modified: trunk/libs/asio/test/buffers_iterator.cpp
==============================================================================
--- trunk/libs/asio/test/buffers_iterator.cpp (original)
+++ trunk/libs/asio/test/buffers_iterator.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,10 +16,17 @@
 // Test that header file is self-contained.
 #include <boost/asio/buffers_iterator.hpp>
 
-#include <boost/array.hpp>
 #include <boost/asio/buffer.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+# include <boost/array.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+# include <array>
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
+
 //------------------------------------------------------------------------------
 
 // buffers_iterator_compile test
@@ -29,7 +36,11 @@
 
 namespace buffers_iterator_compile {
 
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 using boost::array;
+#elif defined(BOOST_ASIO_HAS_STD_ARRAY)
+using std::array;
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 using std::vector;
 using namespace boost::asio;
 
@@ -274,9 +285,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("buffers_iterator");
- test->add(BOOST_TEST_CASE(&buffers_iterator_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "buffers_iterator",
+ BOOST_ASIO_TEST_CASE(buffers_iterator_compile::test)
+)

Modified: trunk/libs/asio/test/completion_condition.cpp
==============================================================================
--- trunk/libs/asio/test/completion_condition.cpp (original)
+++ trunk/libs/asio/test/completion_condition.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("completion_condition");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "completion_condition",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/connect.cpp
==============================================================================
--- trunk/libs/asio/test/connect.cpp (original)
+++ trunk/libs/asio/test/connect.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("connect");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "connect",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/datagram_socket_service.cpp
==============================================================================
--- trunk/libs/asio/test/datagram_socket_service.cpp (original)
+++ trunk/libs/asio/test/datagram_socket_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("datagram_socket_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "datagram_socket_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/deadline_timer.cpp
==============================================================================
--- trunk/libs/asio/test/deadline_timer.cpp (original)
+++ trunk/libs/asio/test/deadline_timer.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,12 +16,15 @@
 // Test that header file is self-contained.
 #include <boost/asio/deadline_timer.hpp>
 
+#include "unit_test.hpp"
+
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
 #include <boost/thread/thread.hpp>
 #include <boost/bind.hpp>
 #include "archetypes/async_result.hpp"
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/placeholders.hpp>
-#include "unit_test.hpp"
 
 using namespace boost::posix_time;
 
@@ -42,7 +45,7 @@
     t->async_wait(boost::bind(decrement_to_zero, t, count));
 
     // Completion cannot nest, so count value should remain unchanged.
- BOOST_CHECK(*count == before_value);
+ BOOST_ASIO_CHECK(*count == before_value);
   }
 }
 
@@ -56,13 +59,13 @@
 void cancel_timer(boost::asio::deadline_timer* t)
 {
   std::size_t num_cancelled = t->cancel();
- BOOST_CHECK(num_cancelled == 1);
+ BOOST_ASIO_CHECK(num_cancelled == 1);
 }
 
 void cancel_one_timer(boost::asio::deadline_timer* t)
 {
   std::size_t num_cancelled = t->cancel_one();
- BOOST_CHECK(num_cancelled == 1);
+ BOOST_ASIO_CHECK(num_cancelled == 1);
 }
 
 ptime now()
@@ -87,7 +90,7 @@
   // The timer must block until after its expiry time.
   ptime end = now();
   ptime expected_end = start + seconds(1);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 
   start = now();
 
@@ -97,7 +100,7 @@
   // The timer must block until after its expiry time.
   end = now();
   expected_end = start + seconds(1) + microseconds(500000);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 
   t2.expires_at(t2.expires_at() + seconds(1));
   t2.wait();
@@ -105,7 +108,7 @@
   // The timer must block until after its expiry time.
   end = now();
   expected_end += seconds(1);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 
   start = now();
 
@@ -115,7 +118,7 @@
   // The timer must block until after its expiry time.
   end = now();
   expected_end = start + seconds(1) + microseconds(200000);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 
   start = now();
 
@@ -123,16 +126,16 @@
   t3.async_wait(boost::bind(increment, &count));
 
   // No completions can be delivered until run() is called.
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.run();
 
   // The run() call will not return until all operations have finished, and
   // this should not be until after the timer's expiry time.
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(count == 1);
   end = now();
   expected_end = start + seconds(1);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 
   count = 3;
   start = now();
@@ -141,17 +144,17 @@
   t4.async_wait(boost::bind(decrement_to_zero, &t4, &count));
 
   // No completions can be delivered until run() is called.
- BOOST_CHECK(count == 3);
+ BOOST_ASIO_CHECK(count == 3);
 
   ios.reset();
   ios.run();
 
   // The run() call will not return until all operations have finished, and
   // this should not be until after the timer's final expiry time.
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
   end = now();
   expected_end = start + seconds(3);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 
   count = 0;
   start = now();
@@ -163,7 +166,7 @@
   t6.async_wait(boost::bind(cancel_timer, &t5));
 
   // No completions can be delivered until run() is called.
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.reset();
   ios.run();
@@ -171,10 +174,10 @@
   // The timer should have been cancelled, so count should not have changed.
   // The total run time should not have been much more than 1 second (and
   // certainly far less than 10 seconds).
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
   end = now();
   expected_end = start + seconds(2);
- BOOST_CHECK(end < expected_end);
+ BOOST_ASIO_CHECK(end < expected_end);
 
   // Wait on the timer again without cancelling it. This time the asynchronous
   // wait should run to completion and increment the counter.
@@ -186,10 +189,10 @@
 
   // The timer should not have been cancelled, so count should have changed.
   // The total time since the timer was created should be more than 10 seconds.
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(count == 1);
   end = now();
   expected_end = start + seconds(10);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 
   count = 0;
   start = now();
@@ -211,10 +214,10 @@
   // One of the waits should not have been cancelled, so count should have
   // changed. The total time since the timer was created should be more than 3
   // seconds.
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(count == 1);
   end = now();
   expected_end = start + seconds(3);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 }
 
 void timer_handler(const boost::system::error_code&)
@@ -235,10 +238,10 @@
   for (int i = 10; i < 20; ++i)
     timers[i].t.async_wait(&timer_handler);
 
- BOOST_CHECK(timers[2].t.cancel() == 1);
- BOOST_CHECK(timers[41].t.cancel() == 1);
+ BOOST_ASIO_CHECK(timers[2].t.cancel() == 1);
+ BOOST_ASIO_CHECK(timers[41].t.cancel() == 1);
   for (int i = 10; i < 20; ++i)
- BOOST_CHECK(timers[i].t.cancel() == 1);
+ BOOST_ASIO_CHECK(timers[i].t.cancel() == 1);
 }
 
 struct custom_allocation_timer_handler
@@ -290,7 +293,7 @@
 
   io_service.run();
 
- BOOST_CHECK(allocation_count == 0);
+ BOOST_ASIO_CHECK(allocation_count == 0);
 }
 
 void io_service_run(boost::asio::io_service* ios)
@@ -320,7 +323,7 @@
   ios.stop();
   th.join();
 
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(count == 1);
 }
 
 void deadline_timer_async_result_test()
@@ -335,13 +338,19 @@
   ios.run();
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("deadline_timer");
- test->add(BOOST_TEST_CASE(&deadline_timer_test));
- test->add(BOOST_TEST_CASE(&deadline_timer_cancel_test));
- test->add(BOOST_TEST_CASE(&deadline_timer_custom_allocation_test));
- test->add(BOOST_TEST_CASE(&deadline_timer_thread_test));
- test->add(BOOST_TEST_CASE(&deadline_timer_async_result_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "deadline_timer",
+ BOOST_ASIO_TEST_CASE(deadline_timer_test)
+ BOOST_ASIO_TEST_CASE(deadline_timer_cancel_test)
+ BOOST_ASIO_TEST_CASE(deadline_timer_custom_allocation_test)
+ BOOST_ASIO_TEST_CASE(deadline_timer_thread_test)
+ BOOST_ASIO_TEST_CASE(deadline_timer_async_result_test)
+)
+#else // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+BOOST_ASIO_TEST_SUITE
+(
+ "deadline_timer",
+ BOOST_ASIO_TEST_CASE(null_test)
+)
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)

Modified: trunk/libs/asio/test/deadline_timer_service.cpp
==============================================================================
--- trunk/libs/asio/test/deadline_timer_service.cpp (original)
+++ trunk/libs/asio/test/deadline_timer_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("deadline_timer_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "deadline_timer_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/error.cpp
==============================================================================
--- trunk/libs/asio/test/error.cpp (original)
+++ trunk/libs/asio/test/error.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -22,23 +22,23 @@
 void test_error_code(const boost::system::error_code& code)
 {
   boost::system::error_code error(code);
- BOOST_CHECK(code == error);
+ BOOST_ASIO_CHECK(code == error);
 
- BOOST_CHECK(!code || error);
- BOOST_CHECK(!code || !!error);
+ BOOST_ASIO_CHECK(!code || error);
+ BOOST_ASIO_CHECK(!code || !!error);
 
   boost::system::error_code error2(error);
- BOOST_CHECK(error == error2);
- BOOST_CHECK(!(error != error2));
+ BOOST_ASIO_CHECK(error == error2);
+ BOOST_ASIO_CHECK(!(error != error2));
 
   boost::system::error_code error3;
   error3 = error;
- BOOST_CHECK(error == error3);
- BOOST_CHECK(!(error != error3));
+ BOOST_ASIO_CHECK(error == error3);
+ BOOST_ASIO_CHECK(!(error != error3));
 
   std::ostringstream os;
   os << error;
- BOOST_CHECK(!os.str().empty());
+ BOOST_ASIO_CHECK(!os.str().empty());
 }
 
 void error_test()
@@ -82,9 +82,8 @@
   test_error_code(boost::asio::error::would_block);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("error");
- test->add(BOOST_TEST_CASE(&error_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "error",
+ BOOST_ASIO_TEST_CASE(error_test)
+)

Modified: trunk/libs/asio/test/high_resolution_timer.cpp
==============================================================================
--- trunk/libs/asio/test/high_resolution_timer.cpp (original)
+++ trunk/libs/asio/test/high_resolution_timer.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -23,9 +23,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("high_resolution_timer");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "high_resolution_timer",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/io_service.cpp
==============================================================================
--- trunk/libs/asio/test/io_service.cpp (original)
+++ trunk/libs/asio/test/io_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,13 +17,40 @@
 #include <boost/asio/io_service.hpp>
 
 #include <sstream>
-#include <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
-#include <boost/asio/deadline_timer.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/deadline_timer.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/steady_timer.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/thread/thread.hpp>
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 using namespace boost::asio;
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+namespace bindns = std;
+#endif
+
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+typedef deadline_timer timer;
+namespace chronons = boost::posix_time;
+#elif defined(BOOST_ASIO_HAS_STD_CHRONO)
+typedef steady_timer timer;
+namespace chronons = std::chrono;
+#elif defined(BOOST_ASIO_HAS_BOOST_CHRONO)
+typedef steady_timer timer;
+namespace chronons = boost::chrono;
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
 void increment(int* count)
 {
   ++(*count);
@@ -36,10 +63,10 @@
     --(*count);
 
     int before_value = *count;
- ios->post(boost::bind(decrement_to_zero, ios, count));
+ ios->post(bindns::bind(decrement_to_zero, ios, count));
 
     // Handler execution cannot nest, so count value should remain unchanged.
- BOOST_CHECK(*count == before_value);
+ BOOST_ASIO_CHECK(*count == before_value);
   }
 }
 
@@ -49,30 +76,30 @@
   {
     --(*count);
 
- ios->dispatch(boost::bind(nested_decrement_to_zero, ios, count));
+ ios->dispatch(bindns::bind(nested_decrement_to_zero, ios, count));
 
     // Handler execution is nested, so count value should now be zero.
- BOOST_CHECK(*count == 0);
+ BOOST_ASIO_CHECK(*count == 0);
   }
 }
 
 void sleep_increment(io_service* ios, int* count)
 {
- deadline_timer t(*ios, boost::posix_time::seconds(2));
+ timer t(*ios, chronons::seconds(2));
   t.wait();
 
   if (++(*count) < 3)
- ios->post(boost::bind(sleep_increment, ios, count));
+ ios->post(bindns::bind(sleep_increment, ios, count));
 }
 
 void start_sleep_increments(io_service* ios, int* count)
 {
   // Give all threads a chance to start.
- deadline_timer t(*ios, boost::posix_time::seconds(2));
+ timer t(*ios, chronons::seconds(2));
   t.wait();
 
   // Start the first of three increments.
- ios->post(boost::bind(sleep_increment, ios, count));
+ ios->post(bindns::bind(sleep_increment, ios, count));
 }
 
 void throw_exception()
@@ -90,150 +117,150 @@
   io_service ios;
   int count = 0;
 
- ios.post(boost::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(!ios.stopped());
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 1);
 
   count = 0;
   ios.reset();
- ios.post(boost::bind(increment, &count));
- ios.post(boost::bind(increment, &count));
- ios.post(boost::bind(increment, &count));
- ios.post(boost::bind(increment, &count));
- ios.post(boost::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(!ios.stopped());
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 5);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 5);
 
   count = 0;
   ios.reset();
   io_service::work* w = new io_service::work(ios);
- ios.post(boost::bind(&io_service::stop, &ios));
- BOOST_CHECK(!ios.stopped());
+ ios.post(bindns::bind(&io_service::stop, &ios));
+ BOOST_ASIO_CHECK(!ios.stopped());
   ios.run();
 
   // The only operation executed should have been to stop run().
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.reset();
- ios.post(boost::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
   delete w;
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(!ios.stopped());
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 1);
 
   count = 10;
   ios.reset();
- ios.post(boost::bind(decrement_to_zero, &ios, &count));
+ ios.post(bindns::bind(decrement_to_zero, &ios, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(!ios.stopped());
- BOOST_CHECK(count == 10);
+ BOOST_ASIO_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(count == 10);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
 
   count = 10;
   ios.reset();
- ios.post(boost::bind(nested_decrement_to_zero, &ios, &count));
+ ios.post(bindns::bind(nested_decrement_to_zero, &ios, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(!ios.stopped());
- BOOST_CHECK(count == 10);
+ BOOST_ASIO_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(count == 10);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
 
   count = 10;
   ios.reset();
- ios.dispatch(boost::bind(nested_decrement_to_zero, &ios, &count));
+ ios.dispatch(bindns::bind(nested_decrement_to_zero, &ios, &count));
 
   // No handlers can be called until run() is called, even though nested
   // delivery was specifically allowed in the previous call.
- BOOST_CHECK(!ios.stopped());
- BOOST_CHECK(count == 10);
+ BOOST_ASIO_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(count == 10);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
 
   count = 0;
   int count2 = 0;
   ios.reset();
- BOOST_CHECK(!ios.stopped());
- ios.post(boost::bind(start_sleep_increments, &ios, &count));
- ios.post(boost::bind(start_sleep_increments, &ios, &count2));
- boost::thread thread1(boost::bind(io_service_run, &ios));
- boost::thread thread2(boost::bind(io_service_run, &ios));
+ BOOST_ASIO_CHECK(!ios.stopped());
+ ios.post(bindns::bind(start_sleep_increments, &ios, &count));
+ ios.post(bindns::bind(start_sleep_increments, &ios, &count2));
+ boost::thread thread1(bindns::bind(io_service_run, &ios));
+ boost::thread thread2(bindns::bind(io_service_run, &ios));
   thread1.join();
   thread2.join();
 
   // The run() calls will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 3);
- BOOST_CHECK(count2 == 3);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 3);
+ BOOST_ASIO_CHECK(count2 == 3);
 
   count = 10;
   io_service ios2;
- ios.dispatch(ios2.wrap(boost::bind(decrement_to_zero, &ios2, &count)));
+ ios.dispatch(ios2.wrap(bindns::bind(decrement_to_zero, &ios2, &count)));
   ios.reset();
- BOOST_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(!ios.stopped());
   ios.run();
 
   // No decrement_to_zero handlers can be called until run() is called on the
   // second io_service object.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 10);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 10);
 
   ios2.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
 
   count = 0;
   int exception_count = 0;
   ios.reset();
   ios.post(&throw_exception);
- ios.post(boost::bind(increment, &count));
- ios.post(boost::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
   ios.post(&throw_exception);
- ios.post(boost::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(!ios.stopped());
- BOOST_CHECK(count == 0);
- BOOST_CHECK(exception_count == 0);
+ BOOST_ASIO_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
+ BOOST_ASIO_CHECK(exception_count == 0);
 
   for (;;)
   {
@@ -249,9 +276,9 @@
   }
 
   // The run() calls will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 3);
- BOOST_CHECK(exception_count == 2);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 3);
+ BOOST_ASIO_CHECK(exception_count == 2);
 }
 
 class test_service : public boost::asio::io_service::service
@@ -276,13 +303,13 @@
 
   boost::asio::use_service<test_service>(ios1);
 
- BOOST_CHECK(boost::asio::has_service<test_service>(ios1));
+ BOOST_ASIO_CHECK(boost::asio::has_service<test_service>(ios1));
 
   test_service* svc1 = new test_service(ios1);
   try
   {
     boost::asio::add_service(ios1, svc1);
- BOOST_ERROR("add_service did not throw");
+ BOOST_ASIO_ERROR("add_service did not throw");
   }
   catch (boost::asio::service_already_exists&)
   {
@@ -294,14 +321,14 @@
   test_service* svc2 = new test_service(ios2);
   boost::asio::add_service(ios2, svc2);
 
- BOOST_CHECK(boost::asio::has_service<test_service>(ios2));
- BOOST_CHECK(&boost::asio::use_service<test_service>(ios2) == svc2);
+ BOOST_ASIO_CHECK(boost::asio::has_service<test_service>(ios2));
+ BOOST_ASIO_CHECK(&boost::asio::use_service<test_service>(ios2) == svc2);
 
   test_service* svc3 = new test_service(ios2);
   try
   {
     boost::asio::add_service(ios2, svc3);
- BOOST_ERROR("add_service did not throw");
+ BOOST_ASIO_ERROR("add_service did not throw");
   }
   catch (boost::asio::service_already_exists&)
   {
@@ -314,20 +341,19 @@
   try
   {
     boost::asio::add_service(ios3, svc4);
- BOOST_ERROR("add_service did not throw");
+ BOOST_ASIO_ERROR("add_service did not throw");
   }
   catch (boost::asio::invalid_service_owner&)
   {
   }
   delete svc4;
 
- BOOST_CHECK(!boost::asio::has_service<test_service>(ios3));
+ BOOST_ASIO_CHECK(!boost::asio::has_service<test_service>(ios3));
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("io_service");
- test->add(BOOST_TEST_CASE(&io_service_test));
- test->add(BOOST_TEST_CASE(&io_service_service_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "io_service",
+ BOOST_ASIO_TEST_CASE(io_service_test)
+ BOOST_ASIO_TEST_CASE(io_service_service_test)
+)

Modified: trunk/libs/asio/test/ip/address.cpp
==============================================================================
--- trunk/libs/asio/test/ip/address.cpp (original)
+++ trunk/libs/asio/test/ip/address.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,6 +17,7 @@
 #include <boost/asio/ip/address.hpp>
 
 #include "../unit_test.hpp"
+#include <sstream>
 
 //------------------------------------------------------------------------------
 
@@ -116,9 +117,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/address");
- test->add(BOOST_TEST_CASE(&ip_address_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/address",
+ BOOST_ASIO_TEST_CASE(ip_address_compile::test)
+)

Modified: trunk/libs/asio/test/ip/address_v4.cpp
==============================================================================
--- trunk/libs/asio/test/ip/address_v4.cpp (original)
+++ trunk/libs/asio/test/ip/address_v4.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -142,128 +142,127 @@
   using boost::asio::ip::address_v4;
 
   address_v4 a1;
- BOOST_CHECK(a1.to_bytes()[0] == 0);
- BOOST_CHECK(a1.to_bytes()[1] == 0);
- BOOST_CHECK(a1.to_bytes()[2] == 0);
- BOOST_CHECK(a1.to_bytes()[3] == 0);
- BOOST_CHECK(a1.to_ulong() == 0);
+ BOOST_ASIO_CHECK(a1.to_bytes()[0] == 0);
+ BOOST_ASIO_CHECK(a1.to_bytes()[1] == 0);
+ BOOST_ASIO_CHECK(a1.to_bytes()[2] == 0);
+ BOOST_ASIO_CHECK(a1.to_bytes()[3] == 0);
+ BOOST_ASIO_CHECK(a1.to_ulong() == 0);
 
   address_v4::bytes_type b1 = {{ 1, 2, 3, 4 }};
   address_v4 a2(b1);
- BOOST_CHECK(a2.to_bytes()[0] == 1);
- BOOST_CHECK(a2.to_bytes()[1] == 2);
- BOOST_CHECK(a2.to_bytes()[2] == 3);
- BOOST_CHECK(a2.to_bytes()[3] == 4);
- BOOST_CHECK(((a2.to_ulong() >> 24) & 0xFF) == b1[0]);
- BOOST_CHECK(((a2.to_ulong() >> 16) & 0xFF) == b1[1]);
- BOOST_CHECK(((a2.to_ulong() >> 8) & 0xFF) == b1[2]);
- BOOST_CHECK((a2.to_ulong() & 0xFF) == b1[3]);
+ BOOST_ASIO_CHECK(a2.to_bytes()[0] == 1);
+ BOOST_ASIO_CHECK(a2.to_bytes()[1] == 2);
+ BOOST_ASIO_CHECK(a2.to_bytes()[2] == 3);
+ BOOST_ASIO_CHECK(a2.to_bytes()[3] == 4);
+ BOOST_ASIO_CHECK(((a2.to_ulong() >> 24) & 0xFF) == b1[0]);
+ BOOST_ASIO_CHECK(((a2.to_ulong() >> 16) & 0xFF) == b1[1]);
+ BOOST_ASIO_CHECK(((a2.to_ulong() >> 8) & 0xFF) == b1[2]);
+ BOOST_ASIO_CHECK((a2.to_ulong() & 0xFF) == b1[3]);
 
   address_v4 a3(0x01020304);
- BOOST_CHECK(a3.to_bytes()[0] == 1);
- BOOST_CHECK(a3.to_bytes()[1] == 2);
- BOOST_CHECK(a3.to_bytes()[2] == 3);
- BOOST_CHECK(a3.to_bytes()[3] == 4);
- BOOST_CHECK(a3.to_ulong() == 0x01020304);
-
- BOOST_CHECK(address_v4(0x7F000001).is_loopback());
- BOOST_CHECK(address_v4(0x7F000002).is_loopback());
- BOOST_CHECK(!address_v4(0x00000000).is_loopback());
- BOOST_CHECK(!address_v4(0x01020304).is_loopback());
-
- BOOST_CHECK(address_v4(0x00000000).is_unspecified());
- BOOST_CHECK(!address_v4(0x7F000001).is_unspecified());
- BOOST_CHECK(!address_v4(0x01020304).is_unspecified());
-
- BOOST_CHECK(address_v4(0x01000000).is_class_a());
- BOOST_CHECK(address_v4(0x7F000000).is_class_a());
- BOOST_CHECK(!address_v4(0x80000000).is_class_a());
- BOOST_CHECK(!address_v4(0xBFFF0000).is_class_a());
- BOOST_CHECK(!address_v4(0xC0000000).is_class_a());
- BOOST_CHECK(!address_v4(0xDFFFFF00).is_class_a());
- BOOST_CHECK(!address_v4(0xE0000000).is_class_a());
- BOOST_CHECK(!address_v4(0xEFFFFFFF).is_class_a());
- BOOST_CHECK(!address_v4(0xF0000000).is_class_a());
- BOOST_CHECK(!address_v4(0xFFFFFFFF).is_class_a());
-
- BOOST_CHECK(!address_v4(0x01000000).is_class_b());
- BOOST_CHECK(!address_v4(0x7F000000).is_class_b());
- BOOST_CHECK(address_v4(0x80000000).is_class_b());
- BOOST_CHECK(address_v4(0xBFFF0000).is_class_b());
- BOOST_CHECK(!address_v4(0xC0000000).is_class_b());
- BOOST_CHECK(!address_v4(0xDFFFFF00).is_class_b());
- BOOST_CHECK(!address_v4(0xE0000000).is_class_b());
- BOOST_CHECK(!address_v4(0xEFFFFFFF).is_class_b());
- BOOST_CHECK(!address_v4(0xF0000000).is_class_b());
- BOOST_CHECK(!address_v4(0xFFFFFFFF).is_class_b());
-
- BOOST_CHECK(!address_v4(0x01000000).is_class_c());
- BOOST_CHECK(!address_v4(0x7F000000).is_class_c());
- BOOST_CHECK(!address_v4(0x80000000).is_class_c());
- BOOST_CHECK(!address_v4(0xBFFF0000).is_class_c());
- BOOST_CHECK(address_v4(0xC0000000).is_class_c());
- BOOST_CHECK(address_v4(0xDFFFFF00).is_class_c());
- BOOST_CHECK(!address_v4(0xE0000000).is_class_c());
- BOOST_CHECK(!address_v4(0xEFFFFFFF).is_class_c());
- BOOST_CHECK(!address_v4(0xF0000000).is_class_c());
- BOOST_CHECK(!address_v4(0xFFFFFFFF).is_class_c());
-
- BOOST_CHECK(!address_v4(0x01000000).is_multicast());
- BOOST_CHECK(!address_v4(0x7F000000).is_multicast());
- BOOST_CHECK(!address_v4(0x80000000).is_multicast());
- BOOST_CHECK(!address_v4(0xBFFF0000).is_multicast());
- BOOST_CHECK(!address_v4(0xC0000000).is_multicast());
- BOOST_CHECK(!address_v4(0xDFFFFF00).is_multicast());
- BOOST_CHECK(address_v4(0xE0000000).is_multicast());
- BOOST_CHECK(address_v4(0xEFFFFFFF).is_multicast());
- BOOST_CHECK(!address_v4(0xF0000000).is_multicast());
- BOOST_CHECK(!address_v4(0xFFFFFFFF).is_multicast());
+ BOOST_ASIO_CHECK(a3.to_bytes()[0] == 1);
+ BOOST_ASIO_CHECK(a3.to_bytes()[1] == 2);
+ BOOST_ASIO_CHECK(a3.to_bytes()[2] == 3);
+ BOOST_ASIO_CHECK(a3.to_bytes()[3] == 4);
+ BOOST_ASIO_CHECK(a3.to_ulong() == 0x01020304);
+
+ BOOST_ASIO_CHECK(address_v4(0x7F000001).is_loopback());
+ BOOST_ASIO_CHECK(address_v4(0x7F000002).is_loopback());
+ BOOST_ASIO_CHECK(!address_v4(0x00000000).is_loopback());
+ BOOST_ASIO_CHECK(!address_v4(0x01020304).is_loopback());
+
+ BOOST_ASIO_CHECK(address_v4(0x00000000).is_unspecified());
+ BOOST_ASIO_CHECK(!address_v4(0x7F000001).is_unspecified());
+ BOOST_ASIO_CHECK(!address_v4(0x01020304).is_unspecified());
+
+ BOOST_ASIO_CHECK(address_v4(0x01000000).is_class_a());
+ BOOST_ASIO_CHECK(address_v4(0x7F000000).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0x80000000).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0xBFFF0000).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0xC0000000).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0xDFFFFF00).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0xE0000000).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0xEFFFFFFF).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0xF0000000).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0xFFFFFFFF).is_class_a());
+
+ BOOST_ASIO_CHECK(!address_v4(0x01000000).is_class_b());
+ BOOST_ASIO_CHECK(!address_v4(0x7F000000).is_class_b());
+ BOOST_ASIO_CHECK(address_v4(0x80000000).is_class_b());
+ BOOST_ASIO_CHECK(address_v4(0xBFFF0000).is_class_b());
+ BOOST_ASIO_CHECK(!address_v4(0xC0000000).is_class_b());
+ BOOST_ASIO_CHECK(!address_v4(0xDFFFFF00).is_class_b());
+ BOOST_ASIO_CHECK(!address_v4(0xE0000000).is_class_b());
+ BOOST_ASIO_CHECK(!address_v4(0xEFFFFFFF).is_class_b());
+ BOOST_ASIO_CHECK(!address_v4(0xF0000000).is_class_b());
+ BOOST_ASIO_CHECK(!address_v4(0xFFFFFFFF).is_class_b());
+
+ BOOST_ASIO_CHECK(!address_v4(0x01000000).is_class_c());
+ BOOST_ASIO_CHECK(!address_v4(0x7F000000).is_class_c());
+ BOOST_ASIO_CHECK(!address_v4(0x80000000).is_class_c());
+ BOOST_ASIO_CHECK(!address_v4(0xBFFF0000).is_class_c());
+ BOOST_ASIO_CHECK(address_v4(0xC0000000).is_class_c());
+ BOOST_ASIO_CHECK(address_v4(0xDFFFFF00).is_class_c());
+ BOOST_ASIO_CHECK(!address_v4(0xE0000000).is_class_c());
+ BOOST_ASIO_CHECK(!address_v4(0xEFFFFFFF).is_class_c());
+ BOOST_ASIO_CHECK(!address_v4(0xF0000000).is_class_c());
+ BOOST_ASIO_CHECK(!address_v4(0xFFFFFFFF).is_class_c());
+
+ BOOST_ASIO_CHECK(!address_v4(0x01000000).is_multicast());
+ BOOST_ASIO_CHECK(!address_v4(0x7F000000).is_multicast());
+ BOOST_ASIO_CHECK(!address_v4(0x80000000).is_multicast());
+ BOOST_ASIO_CHECK(!address_v4(0xBFFF0000).is_multicast());
+ BOOST_ASIO_CHECK(!address_v4(0xC0000000).is_multicast());
+ BOOST_ASIO_CHECK(!address_v4(0xDFFFFF00).is_multicast());
+ BOOST_ASIO_CHECK(address_v4(0xE0000000).is_multicast());
+ BOOST_ASIO_CHECK(address_v4(0xEFFFFFFF).is_multicast());
+ BOOST_ASIO_CHECK(!address_v4(0xF0000000).is_multicast());
+ BOOST_ASIO_CHECK(!address_v4(0xFFFFFFFF).is_multicast());
 
   address_v4 a4 = address_v4::any();
- BOOST_CHECK(a4.to_bytes()[0] == 0);
- BOOST_CHECK(a4.to_bytes()[1] == 0);
- BOOST_CHECK(a4.to_bytes()[2] == 0);
- BOOST_CHECK(a4.to_bytes()[3] == 0);
- BOOST_CHECK(a4.to_ulong() == 0);
+ BOOST_ASIO_CHECK(a4.to_bytes()[0] == 0);
+ BOOST_ASIO_CHECK(a4.to_bytes()[1] == 0);
+ BOOST_ASIO_CHECK(a4.to_bytes()[2] == 0);
+ BOOST_ASIO_CHECK(a4.to_bytes()[3] == 0);
+ BOOST_ASIO_CHECK(a4.to_ulong() == 0);
 
   address_v4 a5 = address_v4::loopback();
- BOOST_CHECK(a5.to_bytes()[0] == 0x7F);
- BOOST_CHECK(a5.to_bytes()[1] == 0);
- BOOST_CHECK(a5.to_bytes()[2] == 0);
- BOOST_CHECK(a5.to_bytes()[3] == 0x01);
- BOOST_CHECK(a5.to_ulong() == 0x7F000001);
+ BOOST_ASIO_CHECK(a5.to_bytes()[0] == 0x7F);
+ BOOST_ASIO_CHECK(a5.to_bytes()[1] == 0);
+ BOOST_ASIO_CHECK(a5.to_bytes()[2] == 0);
+ BOOST_ASIO_CHECK(a5.to_bytes()[3] == 0x01);
+ BOOST_ASIO_CHECK(a5.to_ulong() == 0x7F000001);
 
   address_v4 a6 = address_v4::broadcast();
- BOOST_CHECK(a6.to_bytes()[0] == 0xFF);
- BOOST_CHECK(a6.to_bytes()[1] == 0xFF);
- BOOST_CHECK(a6.to_bytes()[2] == 0xFF);
- BOOST_CHECK(a6.to_bytes()[3] == 0xFF);
- BOOST_CHECK(a6.to_ulong() == 0xFFFFFFFF);
+ BOOST_ASIO_CHECK(a6.to_bytes()[0] == 0xFF);
+ BOOST_ASIO_CHECK(a6.to_bytes()[1] == 0xFF);
+ BOOST_ASIO_CHECK(a6.to_bytes()[2] == 0xFF);
+ BOOST_ASIO_CHECK(a6.to_bytes()[3] == 0xFF);
+ BOOST_ASIO_CHECK(a6.to_ulong() == 0xFFFFFFFF);
 
   address_v4 class_a_net(0xFF000000);
   address_v4 class_b_net(0xFFFF0000);
   address_v4 class_c_net(0xFFFFFF00);
   address_v4 other_net(0xFFFFFFFF);
- BOOST_CHECK(address_v4::netmask(address_v4(0x01000000)) == class_a_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0x7F000000)) == class_a_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0x80000000)) == class_b_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0xBFFF0000)) == class_b_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0xC0000000)) == class_c_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0xDFFFFF00)) == class_c_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0xE0000000)) == other_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0xEFFFFFFF)) == other_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0xF0000000)) == other_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0xFFFFFFFF)) == other_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0x01000000)) == class_a_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0x7F000000)) == class_a_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0x80000000)) == class_b_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xBFFF0000)) == class_b_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xC0000000)) == class_c_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xDFFFFF00)) == class_c_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xE0000000)) == other_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xEFFFFFFF)) == other_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xF0000000)) == other_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xFFFFFFFF)) == other_net);
 }
 
 } // namespace ip_address_v4_runtime
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/address_v4");
- test->add(BOOST_TEST_CASE(&ip_address_v4_compile::test));
- test->add(BOOST_TEST_CASE(&ip_address_v4_runtime::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/address_v4",
+ BOOST_ASIO_TEST_CASE(ip_address_v4_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_address_v4_runtime::test)
+)

Modified: trunk/libs/asio/test/ip/address_v6.cpp
==============================================================================
--- trunk/libs/asio/test/ip/address_v6.cpp (original)
+++ trunk/libs/asio/test/ip/address_v6.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,6 +17,7 @@
 #include <boost/asio/ip/address_v6.hpp>
 
 #include "../unit_test.hpp"
+#include <sstream>
 
 //------------------------------------------------------------------------------
 
@@ -157,33 +158,33 @@
   using boost::asio::ip::address_v6;
 
   address_v6 a1;
- BOOST_CHECK(a1.is_unspecified());
- BOOST_CHECK(a1.scope_id() == 0);
+ BOOST_ASIO_CHECK(a1.is_unspecified());
+ BOOST_ASIO_CHECK(a1.scope_id() == 0);
 
   address_v6::bytes_type b1 = {{ 1, 2, 3, 4, 5,
     6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }};
   address_v6 a2(b1, 12345);
- BOOST_CHECK(a2.to_bytes()[0] == 1);
- BOOST_CHECK(a2.to_bytes()[1] == 2);
- BOOST_CHECK(a2.to_bytes()[2] == 3);
- BOOST_CHECK(a2.to_bytes()[3] == 4);
- BOOST_CHECK(a2.to_bytes()[4] == 5);
- BOOST_CHECK(a2.to_bytes()[5] == 6);
- BOOST_CHECK(a2.to_bytes()[6] == 7);
- BOOST_CHECK(a2.to_bytes()[7] == 8);
- BOOST_CHECK(a2.to_bytes()[8] == 9);
- BOOST_CHECK(a2.to_bytes()[9] == 10);
- BOOST_CHECK(a2.to_bytes()[10] == 11);
- BOOST_CHECK(a2.to_bytes()[11] == 12);
- BOOST_CHECK(a2.to_bytes()[12] == 13);
- BOOST_CHECK(a2.to_bytes()[13] == 14);
- BOOST_CHECK(a2.to_bytes()[14] == 15);
- BOOST_CHECK(a2.to_bytes()[15] == 16);
- BOOST_CHECK(a2.scope_id() == 12345);
+ BOOST_ASIO_CHECK(a2.to_bytes()[0] == 1);
+ BOOST_ASIO_CHECK(a2.to_bytes()[1] == 2);
+ BOOST_ASIO_CHECK(a2.to_bytes()[2] == 3);
+ BOOST_ASIO_CHECK(a2.to_bytes()[3] == 4);
+ BOOST_ASIO_CHECK(a2.to_bytes()[4] == 5);
+ BOOST_ASIO_CHECK(a2.to_bytes()[5] == 6);
+ BOOST_ASIO_CHECK(a2.to_bytes()[6] == 7);
+ BOOST_ASIO_CHECK(a2.to_bytes()[7] == 8);
+ BOOST_ASIO_CHECK(a2.to_bytes()[8] == 9);
+ BOOST_ASIO_CHECK(a2.to_bytes()[9] == 10);
+ BOOST_ASIO_CHECK(a2.to_bytes()[10] == 11);
+ BOOST_ASIO_CHECK(a2.to_bytes()[11] == 12);
+ BOOST_ASIO_CHECK(a2.to_bytes()[12] == 13);
+ BOOST_ASIO_CHECK(a2.to_bytes()[13] == 14);
+ BOOST_ASIO_CHECK(a2.to_bytes()[14] == 15);
+ BOOST_ASIO_CHECK(a2.to_bytes()[15] == 16);
+ BOOST_ASIO_CHECK(a2.scope_id() == 12345);
 
   address_v6 a3;
   a3.scope_id(12345);
- BOOST_CHECK(a3.scope_id() == 12345);
+ BOOST_ASIO_CHECK(a3.scope_id() == 12345);
 
   address_v6 unspecified_address;
   address_v6::bytes_type loopback_bytes = {{ 0 }};
@@ -213,161 +214,160 @@
   address_v6::bytes_type mcast_site_local_bytes = {{ 0xFF, 0x05, 1 }};
   address_v6 mcast_site_local_address(mcast_site_local_bytes);
 
- BOOST_CHECK(!unspecified_address.is_loopback());
- BOOST_CHECK(loopback_address.is_loopback());
- BOOST_CHECK(!link_local_address.is_loopback());
- BOOST_CHECK(!site_local_address.is_loopback());
- BOOST_CHECK(!v4_mapped_address.is_loopback());
- BOOST_CHECK(!v4_compat_address.is_loopback());
- BOOST_CHECK(!mcast_global_address.is_loopback());
- BOOST_CHECK(!mcast_link_local_address.is_loopback());
- BOOST_CHECK(!mcast_node_local_address.is_loopback());
- BOOST_CHECK(!mcast_org_local_address.is_loopback());
- BOOST_CHECK(!mcast_site_local_address.is_loopback());
-
- BOOST_CHECK(unspecified_address.is_unspecified());
- BOOST_CHECK(!loopback_address.is_unspecified());
- BOOST_CHECK(!link_local_address.is_unspecified());
- BOOST_CHECK(!site_local_address.is_unspecified());
- BOOST_CHECK(!v4_mapped_address.is_unspecified());
- BOOST_CHECK(!v4_compat_address.is_unspecified());
- BOOST_CHECK(!mcast_global_address.is_unspecified());
- BOOST_CHECK(!mcast_link_local_address.is_unspecified());
- BOOST_CHECK(!mcast_node_local_address.is_unspecified());
- BOOST_CHECK(!mcast_org_local_address.is_unspecified());
- BOOST_CHECK(!mcast_site_local_address.is_unspecified());
-
- BOOST_CHECK(!unspecified_address.is_link_local());
- BOOST_CHECK(!loopback_address.is_link_local());
- BOOST_CHECK(link_local_address.is_link_local());
- BOOST_CHECK(!site_local_address.is_link_local());
- BOOST_CHECK(!v4_mapped_address.is_link_local());
- BOOST_CHECK(!v4_compat_address.is_link_local());
- BOOST_CHECK(!mcast_global_address.is_link_local());
- BOOST_CHECK(!mcast_link_local_address.is_link_local());
- BOOST_CHECK(!mcast_node_local_address.is_link_local());
- BOOST_CHECK(!mcast_org_local_address.is_link_local());
- BOOST_CHECK(!mcast_site_local_address.is_link_local());
-
- BOOST_CHECK(!unspecified_address.is_site_local());
- BOOST_CHECK(!loopback_address.is_site_local());
- BOOST_CHECK(!link_local_address.is_site_local());
- BOOST_CHECK(site_local_address.is_site_local());
- BOOST_CHECK(!v4_mapped_address.is_site_local());
- BOOST_CHECK(!v4_compat_address.is_site_local());
- BOOST_CHECK(!mcast_global_address.is_site_local());
- BOOST_CHECK(!mcast_link_local_address.is_site_local());
- BOOST_CHECK(!mcast_node_local_address.is_site_local());
- BOOST_CHECK(!mcast_org_local_address.is_site_local());
- BOOST_CHECK(!mcast_site_local_address.is_site_local());
-
- BOOST_CHECK(!unspecified_address.is_v4_mapped());
- BOOST_CHECK(!loopback_address.is_v4_mapped());
- BOOST_CHECK(!link_local_address.is_v4_mapped());
- BOOST_CHECK(!site_local_address.is_v4_mapped());
- BOOST_CHECK(v4_mapped_address.is_v4_mapped());
- BOOST_CHECK(!v4_compat_address.is_v4_mapped());
- BOOST_CHECK(!mcast_global_address.is_v4_mapped());
- BOOST_CHECK(!mcast_link_local_address.is_v4_mapped());
- BOOST_CHECK(!mcast_node_local_address.is_v4_mapped());
- BOOST_CHECK(!mcast_org_local_address.is_v4_mapped());
- BOOST_CHECK(!mcast_site_local_address.is_v4_mapped());
-
- BOOST_CHECK(!unspecified_address.is_v4_compatible());
- BOOST_CHECK(!loopback_address.is_v4_compatible());
- BOOST_CHECK(!link_local_address.is_v4_compatible());
- BOOST_CHECK(!site_local_address.is_v4_compatible());
- BOOST_CHECK(!v4_mapped_address.is_v4_compatible());
- BOOST_CHECK(v4_compat_address.is_v4_compatible());
- BOOST_CHECK(!mcast_global_address.is_v4_compatible());
- BOOST_CHECK(!mcast_link_local_address.is_v4_compatible());
- BOOST_CHECK(!mcast_node_local_address.is_v4_compatible());
- BOOST_CHECK(!mcast_org_local_address.is_v4_compatible());
- BOOST_CHECK(!mcast_site_local_address.is_v4_compatible());
-
- BOOST_CHECK(!unspecified_address.is_multicast());
- BOOST_CHECK(!loopback_address.is_multicast());
- BOOST_CHECK(!link_local_address.is_multicast());
- BOOST_CHECK(!site_local_address.is_multicast());
- BOOST_CHECK(!v4_mapped_address.is_multicast());
- BOOST_CHECK(!v4_compat_address.is_multicast());
- BOOST_CHECK(mcast_global_address.is_multicast());
- BOOST_CHECK(mcast_link_local_address.is_multicast());
- BOOST_CHECK(mcast_node_local_address.is_multicast());
- BOOST_CHECK(mcast_org_local_address.is_multicast());
- BOOST_CHECK(mcast_site_local_address.is_multicast());
-
- BOOST_CHECK(!unspecified_address.is_multicast_global());
- BOOST_CHECK(!loopback_address.is_multicast_global());
- BOOST_CHECK(!link_local_address.is_multicast_global());
- BOOST_CHECK(!site_local_address.is_multicast_global());
- BOOST_CHECK(!v4_mapped_address.is_multicast_global());
- BOOST_CHECK(!v4_compat_address.is_multicast_global());
- BOOST_CHECK(mcast_global_address.is_multicast_global());
- BOOST_CHECK(!mcast_link_local_address.is_multicast_global());
- BOOST_CHECK(!mcast_node_local_address.is_multicast_global());
- BOOST_CHECK(!mcast_org_local_address.is_multicast_global());
- BOOST_CHECK(!mcast_site_local_address.is_multicast_global());
-
- BOOST_CHECK(!unspecified_address.is_multicast_link_local());
- BOOST_CHECK(!loopback_address.is_multicast_link_local());
- BOOST_CHECK(!link_local_address.is_multicast_link_local());
- BOOST_CHECK(!site_local_address.is_multicast_link_local());
- BOOST_CHECK(!v4_mapped_address.is_multicast_link_local());
- BOOST_CHECK(!v4_compat_address.is_multicast_link_local());
- BOOST_CHECK(!mcast_global_address.is_multicast_link_local());
- BOOST_CHECK(mcast_link_local_address.is_multicast_link_local());
- BOOST_CHECK(!mcast_node_local_address.is_multicast_link_local());
- BOOST_CHECK(!mcast_org_local_address.is_multicast_link_local());
- BOOST_CHECK(!mcast_site_local_address.is_multicast_link_local());
-
- BOOST_CHECK(!unspecified_address.is_multicast_node_local());
- BOOST_CHECK(!loopback_address.is_multicast_node_local());
- BOOST_CHECK(!link_local_address.is_multicast_node_local());
- BOOST_CHECK(!site_local_address.is_multicast_node_local());
- BOOST_CHECK(!v4_mapped_address.is_multicast_node_local());
- BOOST_CHECK(!v4_compat_address.is_multicast_node_local());
- BOOST_CHECK(!mcast_global_address.is_multicast_node_local());
- BOOST_CHECK(!mcast_link_local_address.is_multicast_node_local());
- BOOST_CHECK(mcast_node_local_address.is_multicast_node_local());
- BOOST_CHECK(!mcast_org_local_address.is_multicast_node_local());
- BOOST_CHECK(!mcast_site_local_address.is_multicast_node_local());
-
- BOOST_CHECK(!unspecified_address.is_multicast_org_local());
- BOOST_CHECK(!loopback_address.is_multicast_org_local());
- BOOST_CHECK(!link_local_address.is_multicast_org_local());
- BOOST_CHECK(!site_local_address.is_multicast_org_local());
- BOOST_CHECK(!v4_mapped_address.is_multicast_org_local());
- BOOST_CHECK(!v4_compat_address.is_multicast_org_local());
- BOOST_CHECK(!mcast_global_address.is_multicast_org_local());
- BOOST_CHECK(!mcast_link_local_address.is_multicast_org_local());
- BOOST_CHECK(!mcast_node_local_address.is_multicast_org_local());
- BOOST_CHECK(mcast_org_local_address.is_multicast_org_local());
- BOOST_CHECK(!mcast_site_local_address.is_multicast_org_local());
-
- BOOST_CHECK(!unspecified_address.is_multicast_site_local());
- BOOST_CHECK(!loopback_address.is_multicast_site_local());
- BOOST_CHECK(!link_local_address.is_multicast_site_local());
- BOOST_CHECK(!site_local_address.is_multicast_site_local());
- BOOST_CHECK(!v4_mapped_address.is_multicast_site_local());
- BOOST_CHECK(!v4_compat_address.is_multicast_site_local());
- BOOST_CHECK(!mcast_global_address.is_multicast_site_local());
- BOOST_CHECK(!mcast_link_local_address.is_multicast_site_local());
- BOOST_CHECK(!mcast_node_local_address.is_multicast_site_local());
- BOOST_CHECK(!mcast_org_local_address.is_multicast_site_local());
- BOOST_CHECK(mcast_site_local_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!unspecified_address.is_loopback());
+ BOOST_ASIO_CHECK(loopback_address.is_loopback());
+ BOOST_ASIO_CHECK(!link_local_address.is_loopback());
+ BOOST_ASIO_CHECK(!site_local_address.is_loopback());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_loopback());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_loopback());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_loopback());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_loopback());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_loopback());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_loopback());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_loopback());
+
+ BOOST_ASIO_CHECK(unspecified_address.is_unspecified());
+ BOOST_ASIO_CHECK(!loopback_address.is_unspecified());
+ BOOST_ASIO_CHECK(!link_local_address.is_unspecified());
+ BOOST_ASIO_CHECK(!site_local_address.is_unspecified());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_unspecified());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_unspecified());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_unspecified());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_unspecified());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_unspecified());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_unspecified());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_unspecified());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_link_local());
+ BOOST_ASIO_CHECK(!loopback_address.is_link_local());
+ BOOST_ASIO_CHECK(link_local_address.is_link_local());
+ BOOST_ASIO_CHECK(!site_local_address.is_link_local());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_link_local());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_link_local());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_link_local());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_link_local());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_link_local());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_link_local());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_link_local());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_site_local());
+ BOOST_ASIO_CHECK(!loopback_address.is_site_local());
+ BOOST_ASIO_CHECK(!link_local_address.is_site_local());
+ BOOST_ASIO_CHECK(site_local_address.is_site_local());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_site_local());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_site_local());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_site_local());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_site_local());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_site_local());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_site_local());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_site_local());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!loopback_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!link_local_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!site_local_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(v4_mapped_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_v4_mapped());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!loopback_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!link_local_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!site_local_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(v4_compat_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_v4_compatible());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_multicast());
+ BOOST_ASIO_CHECK(!loopback_address.is_multicast());
+ BOOST_ASIO_CHECK(!link_local_address.is_multicast());
+ BOOST_ASIO_CHECK(!site_local_address.is_multicast());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_multicast());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_multicast());
+ BOOST_ASIO_CHECK(mcast_global_address.is_multicast());
+ BOOST_ASIO_CHECK(mcast_link_local_address.is_multicast());
+ BOOST_ASIO_CHECK(mcast_node_local_address.is_multicast());
+ BOOST_ASIO_CHECK(mcast_org_local_address.is_multicast());
+ BOOST_ASIO_CHECK(mcast_site_local_address.is_multicast());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!loopback_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!link_local_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!site_local_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_multicast_global());
+ BOOST_ASIO_CHECK(mcast_global_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_multicast_global());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!loopback_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!link_local_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!site_local_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(mcast_link_local_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_multicast_link_local());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!loopback_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!link_local_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!site_local_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(mcast_node_local_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_multicast_node_local());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!loopback_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!link_local_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!site_local_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(mcast_org_local_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_multicast_org_local());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!loopback_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!link_local_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!site_local_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(mcast_site_local_address.is_multicast_site_local());
 
- BOOST_CHECK(address_v6::loopback().is_loopback());
+ BOOST_ASIO_CHECK(address_v6::loopback().is_loopback());
 }
 
 } // namespace ip_address_v6_runtime
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/address_v6");
- test->add(BOOST_TEST_CASE(&ip_address_v6_compile::test));
- test->add(BOOST_TEST_CASE(&ip_address_v6_runtime::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/address_v6",
+ BOOST_ASIO_TEST_CASE(ip_address_v6_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_address_v6_runtime::test)
+)

Modified: trunk/libs/asio/test/ip/basic_endpoint.cpp
==============================================================================
--- trunk/libs/asio/test/ip/basic_endpoint.cpp (original)
+++ trunk/libs/asio/test/ip/basic_endpoint.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/basic_endpoint");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/basic_endpoint",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/ip/basic_resolver.cpp
==============================================================================
--- trunk/libs/asio/test/ip/basic_resolver.cpp (original)
+++ trunk/libs/asio/test/ip/basic_resolver.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/basic_resolver");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/basic_resolver",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/ip/basic_resolver_entry.cpp
==============================================================================
--- trunk/libs/asio/test/ip/basic_resolver_entry.cpp (original)
+++ trunk/libs/asio/test/ip/basic_resolver_entry.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/basic_resolver_entry");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/basic_resolver_entry",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/ip/basic_resolver_iterator.cpp
==============================================================================
--- trunk/libs/asio/test/ip/basic_resolver_iterator.cpp (original)
+++ trunk/libs/asio/test/ip/basic_resolver_iterator.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/basic_resolver_iterator");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/basic_resolver_iterator",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/ip/basic_resolver_query.cpp
==============================================================================
--- trunk/libs/asio/test/ip/basic_resolver_query.cpp (original)
+++ trunk/libs/asio/test/ip/basic_resolver_query.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/basic_resolver_query");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/basic_resolver_query",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/ip/host_name.cpp
==============================================================================
--- trunk/libs/asio/test/ip/host_name.cpp (original)
+++ trunk/libs/asio/test/ip/host_name.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -48,9 +48,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/host_name");
- test->add(BOOST_TEST_CASE(&ip_host_name_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/host_name",
+ BOOST_ASIO_TEST_CASE(ip_host_name_compile::test)
+)

Modified: trunk/libs/asio/test/ip/icmp.cpp
==============================================================================
--- trunk/libs/asio/test/ip/icmp.cpp (original)
+++ trunk/libs/asio/test/ip/icmp.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,6 @@
 // Test that header file is self-contained.
 #include <boost/asio/ip/icmp.hpp>
 
-#include <boost/bind.hpp>
 #include <cstring>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/placeholders.hpp>
@@ -451,10 +450,9 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/icmp");
- test->add(BOOST_TEST_CASE(&ip_icmp_socket_compile::test));
- test->add(BOOST_TEST_CASE(&ip_icmp_resolver_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/icmp",
+ BOOST_ASIO_TEST_CASE(ip_icmp_socket_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_icmp_resolver_compile::test)
+)

Modified: trunk/libs/asio/test/ip/multicast.cpp
==============================================================================
--- trunk/libs/asio/test/ip/multicast.cpp (original)
+++ trunk/libs/asio/test/ip/multicast.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -131,23 +131,23 @@
   sock_v6.bind(ep_v6, ec);
   bool have_v6 = !ec;
 
- BOOST_CHECK(have_v4 || have_v6);
+ BOOST_ASIO_CHECK(have_v4 || have_v6);
 
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Windows CE seems to have problems with some multicast group addresses.
   // The following address works on CE, but as it is not a private multicast
   // address it will not be used on other platforms.
   const ip::address multicast_address_v4 =
     ip::address::from_string("239.0.0.4", ec);
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   const ip::address multicast_address_v4 =
     ip::address::from_string("239.255.0.1", ec);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK(!have_v4 || !ec);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK(!have_v4 || !ec);
 
   const ip::address multicast_address_v6 =
     ip::address::from_string("ff01::1", ec);
- BOOST_CHECK(!have_v6 || !ec);
+ BOOST_ASIO_CHECK(!have_v6 || !ec);
 
   // join_group class.
 
@@ -155,14 +155,14 @@
   {
     ip::multicast::join_group join_group(multicast_address_v4);
     sock_v4.set_option(join_group, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   }
 
   if (have_v6)
   {
     ip::multicast::join_group join_group(multicast_address_v6);
     sock_v6.set_option(join_group, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   }
 
   // leave_group class.
@@ -171,14 +171,14 @@
   {
     ip::multicast::leave_group leave_group(multicast_address_v4);
     sock_v4.set_option(leave_group, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   }
 
   if (have_v6)
   {
     ip::multicast::leave_group leave_group(multicast_address_v6);
     sock_v6.set_option(leave_group, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   }
 
   // outbound_interface class.
@@ -188,7 +188,7 @@
     ip::multicast::outbound_interface outbound_interface(
         ip::address_v4::loopback());
     sock_v4.set_option(outbound_interface, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   }
 
   if (have_v6)
@@ -199,7 +199,7 @@
     ip::multicast::outbound_interface outbound_interface(1);
 #endif
     sock_v6.set_option(outbound_interface, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   }
 
   // hops class.
@@ -207,47 +207,47 @@
   if (have_v4)
   {
     ip::multicast::hops hops1(1);
- BOOST_CHECK(hops1.value() == 1);
+ BOOST_ASIO_CHECK(hops1.value() == 1);
     sock_v4.set_option(hops1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
     ip::multicast::hops hops2;
     sock_v4.get_option(hops2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(hops2.value() == 1);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(hops2.value() == 1);
 
     ip::multicast::hops hops3(0);
- BOOST_CHECK(hops3.value() == 0);
+ BOOST_ASIO_CHECK(hops3.value() == 0);
     sock_v4.set_option(hops3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
     ip::multicast::hops hops4;
     sock_v4.get_option(hops4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(hops4.value() == 0);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(hops4.value() == 0);
   }
 
   if (have_v6)
   {
     ip::multicast::hops hops1(1);
- BOOST_CHECK(hops1.value() == 1);
+ BOOST_ASIO_CHECK(hops1.value() == 1);
     sock_v6.set_option(hops1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
     ip::multicast::hops hops2;
     sock_v6.get_option(hops2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(hops2.value() == 1);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(hops2.value() == 1);
 
     ip::multicast::hops hops3(0);
- BOOST_CHECK(hops3.value() == 0);
+ BOOST_ASIO_CHECK(hops3.value() == 0);
     sock_v6.set_option(hops3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
     ip::multicast::hops hops4;
     sock_v6.get_option(hops4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(hops4.value() == 0);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(hops4.value() == 0);
   }
 
   // enable_loopback class.
@@ -255,85 +255,85 @@
   if (have_v4)
   {
     ip::multicast::enable_loopback enable_loopback1(true);
- BOOST_CHECK(enable_loopback1.value());
- BOOST_CHECK(static_cast<bool>(enable_loopback1));
- BOOST_CHECK(!!enable_loopback1);
+ BOOST_ASIO_CHECK(enable_loopback1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(enable_loopback1));
+ BOOST_ASIO_CHECK(!!enable_loopback1);
     sock_v4.set_option(enable_loopback1, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
         ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
     ip::multicast::enable_loopback enable_loopback2;
     sock_v4.get_option(enable_loopback2, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Not supported under Windows CE but can get value.
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(enable_loopback2.value());
- BOOST_CHECK(static_cast<bool>(enable_loopback2));
- BOOST_CHECK(!!enable_loopback2);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(enable_loopback2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(enable_loopback2));
+ BOOST_ASIO_CHECK(!!enable_loopback2);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
     ip::multicast::enable_loopback enable_loopback3(false);
- BOOST_CHECK(!enable_loopback3.value());
- BOOST_CHECK(!static_cast<bool>(enable_loopback3));
- BOOST_CHECK(!enable_loopback3);
+ BOOST_ASIO_CHECK(!enable_loopback3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(enable_loopback3));
+ BOOST_ASIO_CHECK(!enable_loopback3);
     sock_v4.set_option(enable_loopback3, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
         ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
     ip::multicast::enable_loopback enable_loopback4;
     sock_v4.get_option(enable_loopback4, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Not supported under Windows CE but can get value.
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!enable_loopback4.value());
- BOOST_CHECK(!static_cast<bool>(enable_loopback4));
- BOOST_CHECK(!enable_loopback4);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!enable_loopback4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(enable_loopback4));
+ BOOST_ASIO_CHECK(!enable_loopback4);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   }
 
   if (have_v6)
   {
     ip::multicast::enable_loopback enable_loopback1(true);
- BOOST_CHECK(enable_loopback1.value());
- BOOST_CHECK(static_cast<bool>(enable_loopback1));
- BOOST_CHECK(!!enable_loopback1);
+ BOOST_ASIO_CHECK(enable_loopback1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(enable_loopback1));
+ BOOST_ASIO_CHECK(!!enable_loopback1);
     sock_v6.set_option(enable_loopback1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
     ip::multicast::enable_loopback enable_loopback2;
     sock_v6.get_option(enable_loopback2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(enable_loopback2.value());
- BOOST_CHECK(static_cast<bool>(enable_loopback2));
- BOOST_CHECK(!!enable_loopback2);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(enable_loopback2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(enable_loopback2));
+ BOOST_ASIO_CHECK(!!enable_loopback2);
 
     ip::multicast::enable_loopback enable_loopback3(false);
- BOOST_CHECK(!enable_loopback3.value());
- BOOST_CHECK(!static_cast<bool>(enable_loopback3));
- BOOST_CHECK(!enable_loopback3);
+ BOOST_ASIO_CHECK(!enable_loopback3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(enable_loopback3));
+ BOOST_ASIO_CHECK(!enable_loopback3);
     sock_v6.set_option(enable_loopback3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
     ip::multicast::enable_loopback enable_loopback4;
     sock_v6.get_option(enable_loopback4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!enable_loopback4.value());
- BOOST_CHECK(!static_cast<bool>(enable_loopback4));
- BOOST_CHECK(!enable_loopback4);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!enable_loopback4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(enable_loopback4));
+ BOOST_ASIO_CHECK(!enable_loopback4);
   }
 }
 
@@ -341,10 +341,9 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/multicast");
- test->add(BOOST_TEST_CASE(&ip_multicast_compile::test));
- test->add(BOOST_TEST_CASE(&ip_multicast_runtime::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/multicast",
+ BOOST_ASIO_TEST_CASE(ip_multicast_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_multicast_runtime::test)
+)

Modified: trunk/libs/asio/test/ip/resolver_query_base.cpp
==============================================================================
--- trunk/libs/asio/test/ip/resolver_query_base.cpp (original)
+++ trunk/libs/asio/test/ip/resolver_query_base.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/resolver_query_base");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/resolver_query_base",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/ip/resolver_service.cpp
==============================================================================
--- trunk/libs/asio/test/ip/resolver_service.cpp (original)
+++ trunk/libs/asio/test/ip/resolver_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/resolver_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/resolver_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/ip/tcp.cpp
==============================================================================
--- trunk/libs/asio/test/ip/tcp.cpp (original)
+++ trunk/libs/asio/test/ip/tcp.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,11 +19,8 @@
 // Test that header file is self-contained.
 #include <boost/asio/ip/tcp.hpp>
 
-#include <boost/array.hpp>
-#include <boost/bind.hpp>
 #include <cstring>
 #include <boost/asio/io_service.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/asio/read.hpp>
 #include <boost/asio/write.hpp>
 #include "../unit_test.hpp"
@@ -32,6 +29,18 @@
 #include "../archetypes/io_control_command.hpp"
 #include "../archetypes/settable_socket_option.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+# include <boost/array.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+# include <array>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 //------------------------------------------------------------------------------
 
 // ip_tcp_compile test
@@ -89,32 +98,32 @@
   // no_delay class.
 
   ip::tcp::no_delay no_delay1(true);
- BOOST_CHECK(no_delay1.value());
- BOOST_CHECK(static_cast<bool>(no_delay1));
- BOOST_CHECK(!!no_delay1);
+ BOOST_ASIO_CHECK(no_delay1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(no_delay1));
+ BOOST_ASIO_CHECK(!!no_delay1);
   sock.set_option(no_delay1, ec);
- BOOST_CHECK(!ec);
+ BOOST_ASIO_CHECK(!ec);
 
   ip::tcp::no_delay no_delay2;
   sock.get_option(no_delay2, ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(no_delay2.value());
- BOOST_CHECK(static_cast<bool>(no_delay2));
- BOOST_CHECK(!!no_delay2);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(no_delay2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(no_delay2));
+ BOOST_ASIO_CHECK(!!no_delay2);
 
   ip::tcp::no_delay no_delay3(false);
- BOOST_CHECK(!no_delay3.value());
- BOOST_CHECK(!static_cast<bool>(no_delay3));
- BOOST_CHECK(!no_delay3);
+ BOOST_ASIO_CHECK(!no_delay3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(no_delay3));
+ BOOST_ASIO_CHECK(!no_delay3);
   sock.set_option(no_delay3, ec);
- BOOST_CHECK(!ec);
+ BOOST_ASIO_CHECK(!ec);
 
   ip::tcp::no_delay no_delay4;
   sock.get_option(no_delay4, ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(!no_delay4.value());
- BOOST_CHECK(!static_cast<bool>(no_delay4));
- BOOST_CHECK(!no_delay4);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(!no_delay4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(no_delay4));
+ BOOST_ASIO_CHECK(!no_delay4);
 }
 
 } // namespace ip_tcp_runtime
@@ -150,6 +159,12 @@
 
 void test()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+ using boost::array;
+#else // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+ using std::array;
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
   using namespace boost::asio;
   namespace ip = boost::asio::ip;
 
@@ -158,10 +173,10 @@
     io_service ios;
     char mutable_char_buffer[128] = "";
     const char const_char_buffer[128] = "";
- boost::array<boost::asio::mutable_buffer, 2> mutable_buffers = {{
+ array<boost::asio::mutable_buffer, 2> mutable_buffers = {{
         boost::asio::buffer(mutable_char_buffer, 10),
         boost::asio::buffer(mutable_char_buffer + 10, 10) }};
- boost::array<boost::asio::const_buffer, 2> const_buffers = {{
+ array<boost::asio::const_buffer, 2> const_buffers = {{
         boost::asio::buffer(const_char_buffer, 10),
         boost::asio::buffer(const_char_buffer + 10, 10) }};
     socket_base::message_flags in_flags = 0;
@@ -448,48 +463,48 @@
     size_t bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!err);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(!err);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void handle_write_noop(const boost::system::error_code& err,
     size_t bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!err);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(!err);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void handle_read(const boost::system::error_code& err,
     size_t bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!err);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(!err);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
 }
 
 void handle_write(const boost::system::error_code& err,
     size_t bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!err);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(!err);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
 }
 
 void handle_read_cancel(const boost::system::error_code& err,
     size_t bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(err == boost::asio::error::operation_aborted);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(err == boost::asio::error::operation_aborted);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void handle_read_eof(const boost::system::error_code& err,
     size_t bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(err == boost::asio::error::eof);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(err == boost::asio::error::eof);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void test()
@@ -498,6 +513,14 @@
   using namespace boost::asio;
   namespace ip = boost::asio::ip;
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   io_service ios;
 
   ip::tcp::acceptor acceptor(ios, ip::tcp::endpoint(ip::tcp::v4(), 0));
@@ -515,27 +538,23 @@
   bool read_noop_completed = false;
   client_side_socket.async_read_some(
       boost::asio::mutable_buffers_1(0, 0),
- boost::bind(handle_read_noop,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- &read_noop_completed));
+ bindns::bind(handle_read_noop,
+ _1, _2, &read_noop_completed));
 
   ios.run();
- BOOST_CHECK(read_noop_completed);
+ BOOST_ASIO_CHECK(read_noop_completed);
 
   // No-op write.
 
   bool write_noop_completed = false;
   client_side_socket.async_write_some(
       boost::asio::const_buffers_1(0, 0),
- boost::bind(handle_write_noop,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- &write_noop_completed));
+ bindns::bind(handle_write_noop,
+ _1, _2, &write_noop_completed));
 
   ios.reset();
   ios.run();
- BOOST_CHECK(write_noop_completed);
+ BOOST_ASIO_CHECK(write_noop_completed);
 
   // Read and write to transfer data.
 
@@ -543,60 +562,52 @@
   bool read_completed = false;
   boost::asio::async_read(client_side_socket,
       boost::asio::buffer(read_buffer),
- boost::bind(handle_read,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- &read_completed));
+ bindns::bind(handle_read,
+ _1, _2, &read_completed));
 
   bool write_completed = false;
   boost::asio::async_write(server_side_socket,
       boost::asio::buffer(write_data),
- boost::bind(handle_write,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- &write_completed));
+ bindns::bind(handle_write,
+ _1, _2, &write_completed));
 
   ios.reset();
   ios.run();
- BOOST_CHECK(read_completed);
- BOOST_CHECK(write_completed);
- BOOST_CHECK(memcmp(read_buffer, write_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(read_completed);
+ BOOST_ASIO_CHECK(write_completed);
+ BOOST_ASIO_CHECK(memcmp(read_buffer, write_data, sizeof(write_data)) == 0);
 
   // Cancelled read.
 
   bool read_cancel_completed = false;
   boost::asio::async_read(server_side_socket,
       boost::asio::buffer(read_buffer),
- boost::bind(handle_read_cancel,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- &read_cancel_completed));
+ bindns::bind(handle_read_cancel,
+ _1, _2, &read_cancel_completed));
 
   ios.reset();
   ios.poll();
- BOOST_CHECK(!read_cancel_completed);
+ BOOST_ASIO_CHECK(!read_cancel_completed);
 
   server_side_socket.cancel();
 
   ios.reset();
   ios.run();
- BOOST_CHECK(read_cancel_completed);
+ BOOST_ASIO_CHECK(read_cancel_completed);
 
   // A read when the peer closes socket should fail with eof.
 
   bool read_eof_completed = false;
   boost::asio::async_read(client_side_socket,
       boost::asio::buffer(read_buffer),
- boost::bind(handle_read_eof,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- &read_eof_completed));
+ bindns::bind(handle_read_eof,
+ _1, _2, &read_eof_completed));
 
   server_side_socket.close();
 
   ios.reset();
   ios.run();
- BOOST_CHECK(read_eof_completed);
+ BOOST_ASIO_CHECK(read_eof_completed);
 }
 
 } // namespace ip_tcp_socket_runtime
@@ -753,12 +764,12 @@
 
 void handle_accept(const boost::system::error_code& err)
 {
- BOOST_CHECK(!err);
+ BOOST_ASIO_CHECK(!err);
 }
 
 void handle_connect(const boost::system::error_code& err)
 {
- BOOST_CHECK(!err);
+ BOOST_ASIO_CHECK(!err);
 }
 
 void test()
@@ -790,11 +801,12 @@
 
   ip::tcp::endpoint client_side_local_endpoint
     = client_side_socket.local_endpoint();
- BOOST_CHECK(client_side_local_endpoint.port() == client_endpoint.port());
+ BOOST_ASIO_CHECK(client_side_local_endpoint.port() == client_endpoint.port());
 
   ip::tcp::endpoint server_side_remote_endpoint
     = server_side_socket.remote_endpoint();
- BOOST_CHECK(server_side_remote_endpoint.port() == client_endpoint.port());
+ BOOST_ASIO_CHECK(server_side_remote_endpoint.port()
+ == client_endpoint.port());
 
   client_side_socket.close();
   server_side_socket.close();
@@ -814,10 +826,11 @@
   ios.run();
 
   client_side_local_endpoint = client_side_socket.local_endpoint();
- BOOST_CHECK(client_side_local_endpoint.port() == client_endpoint.port());
+ BOOST_ASIO_CHECK(client_side_local_endpoint.port() == client_endpoint.port());
 
   server_side_remote_endpoint = server_side_socket.remote_endpoint();
- BOOST_CHECK(server_side_remote_endpoint.port() == client_endpoint.port());
+ BOOST_ASIO_CHECK(server_side_remote_endpoint.port()
+ == client_endpoint.port());
 }
 
 } // namespace ip_tcp_acceptor_runtime
@@ -891,15 +904,14 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/tcp");
- test->add(BOOST_TEST_CASE(&ip_tcp_compile::test));
- test->add(BOOST_TEST_CASE(&ip_tcp_runtime::test));
- test->add(BOOST_TEST_CASE(&ip_tcp_socket_compile::test));
- test->add(BOOST_TEST_CASE(&ip_tcp_socket_runtime::test));
- test->add(BOOST_TEST_CASE(&ip_tcp_acceptor_compile::test));
- test->add(BOOST_TEST_CASE(&ip_tcp_acceptor_runtime::test));
- test->add(BOOST_TEST_CASE(&ip_tcp_resolver_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/tcp",
+ BOOST_ASIO_TEST_CASE(ip_tcp_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_tcp_runtime::test)
+ BOOST_ASIO_TEST_CASE(ip_tcp_socket_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_tcp_socket_runtime::test)
+ BOOST_ASIO_TEST_CASE(ip_tcp_acceptor_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_tcp_acceptor_runtime::test)
+ BOOST_ASIO_TEST_CASE(ip_tcp_resolver_compile::test)
+)

Modified: trunk/libs/asio/test/ip/udp.cpp
==============================================================================
--- trunk/libs/asio/test/ip/udp.cpp (original)
+++ trunk/libs/asio/test/ip/udp.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,16 +16,20 @@
 // Test that header file is self-contained.
 #include <boost/asio/ip/udp.hpp>
 
-#include <boost/bind.hpp>
 #include <cstring>
 #include <boost/asio/io_service.hpp>
-#include <boost/asio/placeholders.hpp>
 #include "../unit_test.hpp"
 #include "../archetypes/gettable_socket_option.hpp"
 #include "../archetypes/async_result.hpp"
 #include "../archetypes/io_control_command.hpp"
 #include "../archetypes/settable_socket_option.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 //------------------------------------------------------------------------------
 
 // ip_udp_socket_compile test
@@ -393,15 +397,15 @@
 void handle_send(size_t expected_bytes_sent,
     const boost::system::error_code& err, size_t bytes_sent)
 {
- BOOST_CHECK(!err);
- BOOST_CHECK(expected_bytes_sent == bytes_sent);
+ BOOST_ASIO_CHECK(!err);
+ BOOST_ASIO_CHECK(expected_bytes_sent == bytes_sent);
 }
 
 void handle_recv(size_t expected_bytes_recvd,
     const boost::system::error_code& err, size_t bytes_recvd)
 {
- BOOST_CHECK(!err);
- BOOST_CHECK(expected_bytes_recvd == bytes_recvd);
+ BOOST_ASIO_CHECK(!err);
+ BOOST_ASIO_CHECK(expected_bytes_recvd == bytes_recvd);
 }
 
 void test()
@@ -410,6 +414,14 @@
   using namespace boost::asio;
   namespace ip = boost::asio::ip;
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   io_service ios;
 
   ip::udp::socket s1(ios, ip::udp::endpoint(ip::udp::v4(), 0));
@@ -427,24 +439,20 @@
   size_t bytes_recvd = s1.receive_from(buffer(recv_msg, sizeof(recv_msg)),
       sender_endpoint);
 
- BOOST_CHECK(bytes_recvd == sizeof(send_msg));
- BOOST_CHECK(memcmp(send_msg, recv_msg, sizeof(send_msg)) == 0);
+ BOOST_ASIO_CHECK(bytes_recvd == sizeof(send_msg));
+ BOOST_ASIO_CHECK(memcmp(send_msg, recv_msg, sizeof(send_msg)) == 0);
 
   memset(recv_msg, 0, sizeof(recv_msg));
 
   target_endpoint = sender_endpoint;
   s1.async_send_to(buffer(send_msg, sizeof(send_msg)), target_endpoint,
- boost::bind(handle_send, sizeof(send_msg),
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred));
+ bindns::bind(handle_send, sizeof(send_msg), _1, _2));
   s2.async_receive_from(buffer(recv_msg, sizeof(recv_msg)), sender_endpoint,
- boost::bind(handle_recv, sizeof(recv_msg),
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred));
+ bindns::bind(handle_recv, sizeof(recv_msg), _1, _2));
 
   ios.run();
 
- BOOST_CHECK(memcmp(send_msg, recv_msg, sizeof(send_msg)) == 0);
+ BOOST_ASIO_CHECK(memcmp(send_msg, recv_msg, sizeof(send_msg)) == 0);
 }
 
 } // namespace ip_udp_socket_runtime
@@ -518,11 +526,10 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/udp");
- test->add(BOOST_TEST_CASE(&ip_udp_socket_compile::test));
- test->add(BOOST_TEST_CASE(&ip_udp_socket_runtime::test));
- test->add(BOOST_TEST_CASE(&ip_udp_resolver_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/udp",
+ BOOST_ASIO_TEST_CASE(ip_udp_socket_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_udp_socket_runtime::test)
+ BOOST_ASIO_TEST_CASE(ip_udp_resolver_compile::test)
+)

Modified: trunk/libs/asio/test/ip/unicast.cpp
==============================================================================
--- trunk/libs/asio/test/ip/unicast.cpp (original)
+++ trunk/libs/asio/test/ip/unicast.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -84,78 +84,78 @@
   sock_v6.bind(ep_v6, ec);
   bool have_v6 = !ec;
 
- BOOST_CHECK(have_v4 || have_v6);
+ BOOST_ASIO_CHECK(have_v4 || have_v6);
 
   // hops class.
 
   if (have_v4)
   {
     ip::unicast::hops hops1(1);
- BOOST_CHECK(hops1.value() == 1);
+ BOOST_ASIO_CHECK(hops1.value() == 1);
     sock_v4.set_option(hops1, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
         ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK(!ec);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK(!ec);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
     ip::unicast::hops hops2;
     sock_v4.get_option(hops2, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
         ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK(!ec);
- BOOST_CHECK(hops2.value() == 1);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(hops2.value() == 1);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
     ip::unicast::hops hops3(255);
- BOOST_CHECK(hops3.value() == 255);
+ BOOST_ASIO_CHECK(hops3.value() == 255);
     sock_v4.set_option(hops3, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
         ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK(!ec);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK(!ec);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
     ip::unicast::hops hops4;
     sock_v4.get_option(hops4, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
         ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK(!ec);
- BOOST_CHECK(hops4.value() == 255);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(hops4.value() == 255);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   }
 
   if (have_v6)
   {
     ip::unicast::hops hops1(1);
- BOOST_CHECK(hops1.value() == 1);
+ BOOST_ASIO_CHECK(hops1.value() == 1);
     sock_v6.set_option(hops1, ec);
- BOOST_CHECK(!ec);
+ BOOST_ASIO_CHECK(!ec);
 
     ip::unicast::hops hops2;
     sock_v6.get_option(hops2, ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(hops2.value() == 1);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(hops2.value() == 1);
 
     ip::unicast::hops hops3(255);
- BOOST_CHECK(hops3.value() == 255);
+ BOOST_ASIO_CHECK(hops3.value() == 255);
     sock_v6.set_option(hops3, ec);
- BOOST_CHECK(!ec);
+ BOOST_ASIO_CHECK(!ec);
 
     ip::unicast::hops hops4;
     sock_v6.get_option(hops4, ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(hops4.value() == 255);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(hops4.value() == 255);
   }
 }
 
@@ -163,10 +163,9 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/unicast");
- test->add(BOOST_TEST_CASE(&ip_unicast_compile::test));
- test->add(BOOST_TEST_CASE(&ip_unicast_runtime::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/unicast",
+ BOOST_ASIO_TEST_CASE(ip_unicast_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_unicast_runtime::test)
+)

Modified: trunk/libs/asio/test/ip/v6_only.cpp
==============================================================================
--- trunk/libs/asio/test/ip/v6_only.cpp (original)
+++ trunk/libs/asio/test/ip/v6_only.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -87,38 +87,38 @@
   {
     ip::v6_only v6_only1;
     acceptor_v6.get_option(v6_only1, ec);
- BOOST_CHECK(!ec);
+ BOOST_ASIO_CHECK(!ec);
     bool have_dual_stack = !v6_only1.value();
 
     if (have_dual_stack)
     {
       ip::v6_only v6_only2(false);
- BOOST_CHECK(!v6_only2.value());
- BOOST_CHECK(!static_cast<bool>(v6_only2));
- BOOST_CHECK(!v6_only2);
+ BOOST_ASIO_CHECK(!v6_only2.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(v6_only2));
+ BOOST_ASIO_CHECK(!v6_only2);
       acceptor_v6.set_option(v6_only2, ec);
- BOOST_CHECK(!ec);
+ BOOST_ASIO_CHECK(!ec);
 
       ip::v6_only v6_only3;
       acceptor_v6.get_option(v6_only3, ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(!v6_only3.value());
- BOOST_CHECK(!static_cast<bool>(v6_only3));
- BOOST_CHECK(!v6_only3);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(!v6_only3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(v6_only3));
+ BOOST_ASIO_CHECK(!v6_only3);
 
       ip::v6_only v6_only4(true);
- BOOST_CHECK(v6_only4.value());
- BOOST_CHECK(static_cast<bool>(v6_only4));
- BOOST_CHECK(!!v6_only4);
+ BOOST_ASIO_CHECK(v6_only4.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(v6_only4));
+ BOOST_ASIO_CHECK(!!v6_only4);
       acceptor_v6.set_option(v6_only4, ec);
- BOOST_CHECK(!ec);
+ BOOST_ASIO_CHECK(!ec);
 
       ip::v6_only v6_only5;
       acceptor_v6.get_option(v6_only5, ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(v6_only5.value());
- BOOST_CHECK(static_cast<bool>(v6_only5));
- BOOST_CHECK(!!v6_only5);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(v6_only5.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(v6_only5));
+ BOOST_ASIO_CHECK(!!v6_only5);
     }
   }
 }
@@ -127,10 +127,9 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/v6_only");
- test->add(BOOST_TEST_CASE(&ip_v6_only_compile::test));
- test->add(BOOST_TEST_CASE(&ip_v6_only_runtime::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/v6_only",
+ BOOST_ASIO_TEST_CASE(ip_v6_only_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_v6_only_runtime::test)
+)

Modified: trunk/libs/asio/test/is_read_buffered.cpp
==============================================================================
--- trunk/libs/asio/test/is_read_buffered.cpp (original)
+++ trunk/libs/asio/test/is_read_buffered.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,8 +16,6 @@
 // Test that header file is self-contained.
 #include <boost/asio/is_read_buffered.hpp>
 
-#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
 #include <boost/asio/buffered_read_stream.hpp>
 #include <boost/asio/buffered_write_stream.hpp>
 #include <boost/asio/io_service.hpp>
@@ -27,7 +25,6 @@
 using namespace std; // For memcmp, memcpy and memset.
 
 class test_stream
- : private boost::noncopyable
 {
 public:
   typedef boost::asio::io_service io_service_type;
@@ -95,35 +92,34 @@
 
 void is_read_buffered_test()
 {
- BOOST_CHECK(!boost::asio::is_read_buffered<
+ BOOST_ASIO_CHECK(!boost::asio::is_read_buffered<
       boost::asio::ip::tcp::socket>::value);
 
- BOOST_CHECK(!!boost::asio::is_read_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_read_buffered<
       boost::asio::buffered_read_stream<
         boost::asio::ip::tcp::socket> >::value);
 
- BOOST_CHECK(!boost::asio::is_read_buffered<
+ BOOST_ASIO_CHECK(!boost::asio::is_read_buffered<
       boost::asio::buffered_write_stream<
         boost::asio::ip::tcp::socket> >::value);
 
- BOOST_CHECK(!!boost::asio::is_read_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_read_buffered<
       boost::asio::buffered_stream<boost::asio::ip::tcp::socket> >::value);
 
- BOOST_CHECK(!boost::asio::is_read_buffered<test_stream>::value);
+ BOOST_ASIO_CHECK(!boost::asio::is_read_buffered<test_stream>::value);
 
- BOOST_CHECK(!!boost::asio::is_read_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_read_buffered<
       boost::asio::buffered_read_stream<test_stream> >::value);
 
- BOOST_CHECK(!boost::asio::is_read_buffered<
+ BOOST_ASIO_CHECK(!boost::asio::is_read_buffered<
       boost::asio::buffered_write_stream<test_stream> >::value);
 
- BOOST_CHECK(!!boost::asio::is_read_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_read_buffered<
       boost::asio::buffered_stream<test_stream> >::value);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("is_read_buffered");
- test->add(BOOST_TEST_CASE(&is_read_buffered_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "is_read_buffered",
+ BOOST_ASIO_TEST_CASE(is_read_buffered_test)
+)

Modified: trunk/libs/asio/test/is_write_buffered.cpp
==============================================================================
--- trunk/libs/asio/test/is_write_buffered.cpp (original)
+++ trunk/libs/asio/test/is_write_buffered.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,8 +16,6 @@
 // Test that header file is self-contained.
 #include <boost/asio/is_write_buffered.hpp>
 
-#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
 #include <boost/asio/buffered_read_stream.hpp>
 #include <boost/asio/buffered_write_stream.hpp>
 #include <boost/asio/io_service.hpp>
@@ -27,7 +25,6 @@
 using namespace std; // For memcmp, memcpy and memset.
 
 class test_stream
- : private boost::noncopyable
 {
 public:
   typedef boost::asio::io_service io_service_type;
@@ -95,35 +92,34 @@
 
 void is_write_buffered_test()
 {
- BOOST_CHECK(!boost::asio::is_write_buffered<
+ BOOST_ASIO_CHECK(!boost::asio::is_write_buffered<
       boost::asio::ip::tcp::socket>::value);
 
- BOOST_CHECK(!boost::asio::is_write_buffered<
+ BOOST_ASIO_CHECK(!boost::asio::is_write_buffered<
       boost::asio::buffered_read_stream<
         boost::asio::ip::tcp::socket> >::value);
 
- BOOST_CHECK(!!boost::asio::is_write_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_write_buffered<
       boost::asio::buffered_write_stream<
         boost::asio::ip::tcp::socket> >::value);
 
- BOOST_CHECK(!!boost::asio::is_write_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_write_buffered<
       boost::asio::buffered_stream<boost::asio::ip::tcp::socket> >::value);
 
- BOOST_CHECK(!boost::asio::is_write_buffered<test_stream>::value);
+ BOOST_ASIO_CHECK(!boost::asio::is_write_buffered<test_stream>::value);
 
- BOOST_CHECK(!boost::asio::is_write_buffered<
+ BOOST_ASIO_CHECK(!boost::asio::is_write_buffered<
       boost::asio::buffered_read_stream<test_stream> >::value);
 
- BOOST_CHECK(!!boost::asio::is_write_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_write_buffered<
       boost::asio::buffered_write_stream<test_stream> >::value);
 
- BOOST_CHECK(!!boost::asio::is_write_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_write_buffered<
       boost::asio::buffered_stream<test_stream> >::value);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("is_write_buffered");
- test->add(BOOST_TEST_CASE(&is_write_buffered_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "is_write_buffered",
+ BOOST_ASIO_TEST_CASE(is_write_buffered_test)
+)

Modified: trunk/libs/asio/test/latency/high_res_clock.hpp
==============================================================================
--- trunk/libs/asio/test/latency/high_res_clock.hpp (original)
+++ trunk/libs/asio/test/latency/high_res_clock.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -14,7 +14,7 @@
 #include <boost/config.hpp>
 #include <boost/cstdint.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 inline boost::uint64_t high_res_clock()
 {

Modified: trunk/libs/asio/test/local/basic_endpoint.cpp
==============================================================================
--- trunk/libs/asio/test/local/basic_endpoint.cpp (original)
+++ trunk/libs/asio/test/local/basic_endpoint.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("local/basic_endpoint");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "local/basic_endpoint",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/local/connect_pair.cpp
==============================================================================
--- trunk/libs/asio/test/local/connect_pair.cpp (original)
+++ trunk/libs/asio/test/local/connect_pair.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -70,9 +70,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("local/connect_pair");
- test->add(BOOST_TEST_CASE(&local_connect_pair_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "local/connect_pair",
+ BOOST_ASIO_TEST_CASE(local_connect_pair_compile::test)
+)

Modified: trunk/libs/asio/test/local/datagram_protocol.cpp
==============================================================================
--- trunk/libs/asio/test/local/datagram_protocol.cpp (original)
+++ trunk/libs/asio/test/local/datagram_protocol.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,6 @@
 // Test that header file is self-contained.
 #include <boost/asio/local/datagram_protocol.hpp>
 
-#include <boost/bind.hpp>
 #include <cstring>
 #include <boost/asio/io_service.hpp>
 #include "../unit_test.hpp"
@@ -225,9 +224,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("local/datagram_protocol");
- test->add(BOOST_TEST_CASE(&local_datagram_protocol_socket_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "local/datagram_protocol",
+ BOOST_ASIO_TEST_CASE(local_datagram_protocol_socket_compile::test)
+)

Modified: trunk/libs/asio/test/local/stream_protocol.cpp
==============================================================================
--- trunk/libs/asio/test/local/stream_protocol.cpp (original)
+++ trunk/libs/asio/test/local/stream_protocol.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,7 +16,6 @@
 // Test that header file is self-contained.
 #include <boost/asio/local/stream_protocol.hpp>
 
-#include <boost/bind.hpp>
 #include <cstring>
 #include <boost/asio/io_service.hpp>
 #include "../unit_test.hpp"
@@ -202,9 +201,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("local/stream_protocol");
- test->add(BOOST_TEST_CASE(&local_stream_protocol_socket_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "local/stream_protocol",
+ BOOST_ASIO_TEST_CASE(local_stream_protocol_socket_compile::test)
+)

Modified: trunk/libs/asio/test/placeholders.cpp
==============================================================================
--- trunk/libs/asio/test/placeholders.cpp (original)
+++ trunk/libs/asio/test/placeholders.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("placeholders");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "placeholders",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/posix/basic_descriptor.cpp
==============================================================================
--- trunk/libs/asio/test/posix/basic_descriptor.cpp (original)
+++ trunk/libs/asio/test/posix/basic_descriptor.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("posix/basic_descriptor");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "posix/basic_descriptor",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/posix/basic_stream_descriptor.cpp
==============================================================================
--- trunk/libs/asio/test/posix/basic_stream_descriptor.cpp (original)
+++ trunk/libs/asio/test/posix/basic_stream_descriptor.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("posix/basic_stream_descriptor");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "posix/basic_stream_descriptor",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/posix/descriptor_base.cpp
==============================================================================
--- trunk/libs/asio/test/posix/descriptor_base.cpp (original)
+++ trunk/libs/asio/test/posix/descriptor_base.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("posix/descriptor_base");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "posix/descriptor_base",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/posix/stream_descriptor.cpp
==============================================================================
--- trunk/libs/asio/test/posix/stream_descriptor.cpp (original)
+++ trunk/libs/asio/test/posix/stream_descriptor.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -165,9 +165,9 @@
 } // namespace posix_stream_descriptor_compile
 
 //------------------------------------------------------------------------------
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("posix/stream_descriptor");
- test->add(BOOST_TEST_CASE(&posix_stream_descriptor_compile::test));
- return test;
-}
+
+BOOST_ASIO_TEST_SUITE
+(
+ "posix/stream_descriptor",
+ BOOST_ASIO_TEST_CASE(posix_stream_descriptor_compile::test)
+)

Modified: trunk/libs/asio/test/posix/stream_descriptor_service.cpp
==============================================================================
--- trunk/libs/asio/test/posix/stream_descriptor_service.cpp (original)
+++ trunk/libs/asio/test/posix/stream_descriptor_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("posix/stream_descriptor_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "posix/stream_descriptor_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/raw_socket_service.cpp
==============================================================================
--- trunk/libs/asio/test/raw_socket_service.cpp (original)
+++ trunk/libs/asio/test/raw_socket_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("raw_socket_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "raw_socket_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/read.cpp
==============================================================================
--- trunk/libs/asio/test/read.cpp (original)
+++ trunk/libs/asio/test/read.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,24 +16,30 @@
 // Test that header file is self-contained.
 #include <boost/asio/read.hpp>
 
-#if defined(BOOST_ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
-#include <boost/array.hpp>
-#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
 #include <cstring>
 #include <vector>
 #include "archetypes/async_result.hpp"
 #include <boost/asio/io_service.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/asio/streambuf.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+#include <boost/array.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+# include <array>
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
+
 using namespace std; // For memcmp, memcpy and memset.
 
 class test_stream
- : private boost::noncopyable
 {
 public:
   typedef boost::asio::io_service io_service_type;
@@ -53,7 +59,7 @@
 
   void reset(const void* data, size_t length)
   {
- BOOST_CHECK(length <= max_length);
+ BOOST_ASIO_CHECK(length <= max_length);
 
     memcpy(data_, data, length);
     length_ = length;
@@ -134,7 +140,7 @@
   std::vector<boost::asio::mutable_buffer> buffers;
 
   size_t bytes_transferred = boost::asio::read(s, buffers);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void test_2_arg_mutable_buffers_1_read()
@@ -148,22 +154,22 @@
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_2_arg_vector_buffers_read()
@@ -178,22 +184,22 @@
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_2_arg_streambuf_read()
@@ -205,25 +211,25 @@
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   size_t bytes_transferred = boost::asio::read(s, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 }
 
 void test_3_arg_nothrow_zero_buffers_read()
@@ -234,8 +240,8 @@
 
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read(s, buffers, error);
- BOOST_CHECK(bytes_transferred == 0);
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_3_arg_nothrow_mutable_buffers_1_read()
@@ -250,25 +256,25 @@
   memset(read_buf, 0, sizeof(read_buf));
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_3_arg_nothrow_vector_buffers_read()
@@ -284,25 +290,25 @@
   memset(read_buf, 0, sizeof(read_buf));
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_3_arg_nothrow_streambuf_read()
@@ -315,28 +321,28 @@
   sb.consume(sb.size());
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read(s, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 bool old_style_transfer_all(const boost::system::error_code& ec,
@@ -363,202 +369,202 @@
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_3_arg_vector_buffers_read()
@@ -574,202 +580,202 @@
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_3_arg_streambuf_read()
@@ -782,229 +788,229 @@
   sb.consume(sb.size());
   size_t bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(sb.data(), 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 50));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 }
 
 void test_4_arg_mutable_buffers_1_read()
@@ -1020,9 +1026,9 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1030,9 +1036,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1040,18 +1046,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1059,9 +1065,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1069,18 +1075,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1088,9 +1094,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1098,18 +1104,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1117,9 +1123,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1127,18 +1133,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1146,9 +1152,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1156,18 +1162,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1175,9 +1181,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1185,18 +1191,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1204,9 +1210,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1214,17 +1220,17 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1232,9 +1238,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1242,34 +1248,34 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_vector_buffers_read()
@@ -1286,9 +1292,9 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1296,9 +1302,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1306,18 +1312,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1325,9 +1331,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1335,18 +1341,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1354,9 +1360,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1364,18 +1370,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1383,9 +1389,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1393,18 +1399,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1412,9 +1418,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1422,18 +1428,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1441,9 +1447,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1451,18 +1457,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1470,9 +1476,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1480,17 +1486,17 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1498,9 +1504,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1508,34 +1514,34 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_streambuf_read()
@@ -1549,10 +1555,10 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1560,10 +1566,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1571,20 +1577,20 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1592,10 +1598,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1603,20 +1609,20 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1624,10 +1630,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1635,20 +1641,20 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1656,10 +1662,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1667,20 +1673,20 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(sb.data(), 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1688,10 +1694,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1699,20 +1705,20 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1720,10 +1726,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1731,20 +1737,20 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1752,10 +1758,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1763,19 +1769,19 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1783,10 +1789,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1794,50 +1800,58 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void async_read_handler(const boost::system::error_code& e,
     size_t bytes_transferred, size_t expected_bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!e);
- BOOST_CHECK(bytes_transferred == expected_bytes_transferred);
+ BOOST_ASIO_CHECK(!e);
+ BOOST_ASIO_CHECK(bytes_transferred == expected_bytes_transferred);
 }
 
 void test_3_arg_mutable_buffers_1_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   char read_buf[sizeof(read_data)];
@@ -1848,54 +1862,57 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read(s, buffers, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_3_arg_boost_array_buffers_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
   char read_buf[sizeof(read_data)];
@@ -1907,54 +1924,57 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read(s, buffers, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_3_arg_std_array_buffers_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
@@ -1967,55 +1987,57 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read(s, buffers, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_3_arg_vector_buffers_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   char read_buf[sizeof(read_data)];
@@ -2027,54 +2049,56 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read(s, buffers, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_3_arg_streambuf_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::streambuf sb(sizeof(read_data));
@@ -2083,58 +2107,60 @@
   sb.consume(sb.size());
   bool called = false;
   boost::asio::async_read(s, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   int i = boost::asio::async_read(s, sb, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 }
 
 void test_4_arg_mutable_buffers_1_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   char read_buf[sizeof(read_data)];
@@ -2145,383 +2171,338 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read(s, buffers,
       short_transfer, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_4_arg_boost_array_buffers_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
   char read_buf[sizeof(read_data)];
@@ -2533,383 +2514,338 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read(s, buffers,
       short_transfer, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_4_arg_std_array_buffers_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
@@ -2922,384 +2858,338 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read(s, buffers,
       short_transfer, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_4_arg_vector_buffers_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   char read_buf[sizeof(read_data)];
@@ -3311,383 +3201,337 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read(s, buffers,
       short_transfer, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_4_arg_streambuf_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::streambuf sb(sizeof(read_data));
@@ -3696,435 +3540,380 @@
   sb.consume(sb.size());
   bool called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(sb.data(), 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 50));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   int i = boost::asio::async_read(s, sb,
       short_transfer, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("read");
- test->add(BOOST_TEST_CASE(&test_2_arg_zero_buffers_read));
- test->add(BOOST_TEST_CASE(&test_2_arg_mutable_buffers_1_read));
- test->add(BOOST_TEST_CASE(&test_2_arg_vector_buffers_read));
- test->add(BOOST_TEST_CASE(&test_2_arg_streambuf_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_zero_buffers_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_mutable_buffers_1_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_vector_buffers_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_streambuf_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_mutable_buffers_1_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_vector_buffers_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_streambuf_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_streambuf_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_mutable_buffers_1_async_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_boost_array_buffers_async_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_std_array_buffers_async_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_vector_buffers_async_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_streambuf_async_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_async_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_async_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_boost_array_buffers_async_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_std_array_buffers_async_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_streambuf_async_read));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "read",
+ BOOST_ASIO_TEST_CASE(test_2_arg_zero_buffers_read)
+ BOOST_ASIO_TEST_CASE(test_2_arg_mutable_buffers_1_read)
+ BOOST_ASIO_TEST_CASE(test_2_arg_vector_buffers_read)
+ BOOST_ASIO_TEST_CASE(test_2_arg_streambuf_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_zero_buffers_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_mutable_buffers_1_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_vector_buffers_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_streambuf_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_mutable_buffers_1_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_vector_buffers_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_streambuf_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_streambuf_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_mutable_buffers_1_async_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_boost_array_buffers_async_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_std_array_buffers_async_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_vector_buffers_async_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_streambuf_async_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_async_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_async_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_boost_array_buffers_async_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_std_array_buffers_async_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_streambuf_async_read)
+)

Modified: trunk/libs/asio/test/read_at.cpp
==============================================================================
--- trunk/libs/asio/test/read_at.cpp (original)
+++ trunk/libs/asio/test/read_at.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,23 +16,29 @@
 // Test that header file is self-contained.
 #include <boost/asio/read_at.hpp>
 
-#if defined(BOOST_ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
-#include <boost/array.hpp>
-#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
 #include <cstring>
 #include "archetypes/async_result.hpp"
 #include <boost/asio/io_service.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/asio/streambuf.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+#include <boost/array.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+# include <array>
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
+
 using namespace std; // For memcmp, memcpy and memset.
 
 class test_random_access_device
- : private boost::noncopyable
 {
 public:
   typedef boost::asio::io_service io_service_type;
@@ -51,7 +57,7 @@
 
   void reset(const void* data, size_t length)
   {
- BOOST_CHECK(length <= max_length);
+ BOOST_ASIO_CHECK(length <= max_length);
 
     length_ = 0;
     while (length_ + length < max_length)
@@ -69,7 +75,7 @@
   }
 
   template <typename Const_Buffers>
- bool check_buffers(boost::uint64_t offset,
+ bool check_buffers(boost::asio::uint64_t offset,
       const Const_Buffers& buffers, size_t length)
   {
     if (offset + length > max_length)
@@ -93,7 +99,8 @@
   }
 
   template <typename Mutable_Buffers>
- size_t read_some_at(boost::uint64_t offset, const Mutable_Buffers& buffers)
+ size_t read_some_at(boost::asio::uint64_t offset,
+ const Mutable_Buffers& buffers)
   {
     return boost::asio::buffer_copy(buffers,
         boost::asio::buffer(data_, length_) + offset,
@@ -101,7 +108,7 @@
   }
 
   template <typename Mutable_Buffers>
- size_t read_some_at(boost::uint64_t offset,
+ size_t read_some_at(boost::asio::uint64_t offset,
       const Mutable_Buffers& buffers, boost::system::error_code& ec)
   {
     ec = boost::system::error_code();
@@ -109,7 +116,7 @@
   }
 
   template <typename Mutable_Buffers, typename Handler>
- void async_read_some_at(boost::uint64_t offset,
+ void async_read_some_at(boost::asio::uint64_t offset,
       const Mutable_Buffers& buffers, Handler handler)
   {
     size_t bytes_transferred = read_some_at(offset, buffers);
@@ -139,42 +146,42 @@
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_3_arg_vector_buffers_read_at()
@@ -189,42 +196,42 @@
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_3_arg_streambuf_read_at()
@@ -236,48 +243,48 @@
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   size_t bytes_transferred = boost::asio::read_at(s, 0, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 }
 
 void test_4_arg_nothrow_mutable_buffers_1_read_at()
@@ -292,48 +299,48 @@
   memset(read_buf, 0, sizeof(read_buf));
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_nothrow_vector_buffers_read_at()
@@ -349,48 +356,48 @@
   memset(read_buf, 0, sizeof(read_buf));
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_nothrow_streambuf_read_at()
@@ -403,54 +410,54 @@
   sb.consume(sb.size());
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read_at(s, 0, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 bool old_style_transfer_all(const boost::system::error_code& ec,
@@ -477,409 +484,409 @@
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_4_arg_vector_buffers_read_at()
@@ -895,409 +902,409 @@
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_4_arg_streambuf_read_at()
@@ -1310,463 +1317,463 @@
   sb.consume(sb.size());
   size_t bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 50));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 }
 
 void test_5_arg_mutable_buffers_1_read_at()
@@ -1782,17 +1789,17 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1800,9 +1807,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1810,9 +1817,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1820,9 +1827,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1830,27 +1837,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1858,9 +1865,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1868,9 +1875,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1878,9 +1885,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1888,27 +1895,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1916,9 +1923,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1926,9 +1933,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1936,9 +1943,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1946,27 +1953,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1974,9 +1981,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1984,9 +1991,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1994,9 +2001,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2004,27 +2011,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2032,9 +2039,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2042,9 +2049,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2052,9 +2059,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2062,27 +2069,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2090,9 +2097,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2100,9 +2107,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2110,9 +2117,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2120,27 +2127,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2148,9 +2155,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2158,9 +2165,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2168,9 +2175,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2178,25 +2185,25 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2204,9 +2211,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2214,9 +2221,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2224,9 +2231,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2234,25 +2241,25 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2260,9 +2267,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2270,9 +2277,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2280,9 +2287,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2290,9 +2297,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_5_arg_vector_buffers_read_at()
@@ -2309,17 +2316,17 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2327,9 +2334,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2337,9 +2344,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2347,9 +2354,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2357,27 +2364,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2385,9 +2392,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2395,9 +2402,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2405,9 +2412,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2415,27 +2422,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2443,9 +2450,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2453,9 +2460,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2463,9 +2470,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2473,27 +2480,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2501,9 +2508,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2511,9 +2518,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2521,9 +2528,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2531,27 +2538,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2559,9 +2566,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2569,9 +2576,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2579,9 +2586,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2589,27 +2596,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2617,9 +2624,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2627,9 +2634,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2637,9 +2644,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2647,27 +2654,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2675,9 +2682,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2685,9 +2692,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2695,9 +2702,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2705,25 +2712,25 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2731,9 +2738,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2741,9 +2748,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2751,9 +2758,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2761,25 +2768,25 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2787,9 +2794,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2797,9 +2804,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2807,9 +2814,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2817,9 +2824,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_5_arg_streambuf_read_at()
@@ -2833,19 +2840,19 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2853,10 +2860,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2864,10 +2871,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2875,10 +2882,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2886,30 +2893,30 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2917,10 +2924,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2928,10 +2935,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2939,10 +2946,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2950,30 +2957,30 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2981,10 +2988,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2992,10 +2999,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3003,10 +3010,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3014,30 +3021,30 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3045,10 +3052,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3056,10 +3063,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3067,10 +3074,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3078,30 +3085,30 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3109,10 +3116,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3120,10 +3127,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3131,10 +3138,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3142,30 +3149,30 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3173,10 +3180,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3184,10 +3191,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3195,10 +3202,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3206,30 +3213,30 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3237,10 +3244,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3248,10 +3255,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3259,10 +3266,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3270,28 +3277,28 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3299,10 +3306,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3310,10 +3317,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3321,10 +3328,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3332,28 +3339,28 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3361,10 +3368,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3372,10 +3379,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3383,10 +3390,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3394,22 +3401,30 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void async_read_handler(const boost::system::error_code& e,
     size_t bytes_transferred, size_t expected_bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!e);
- BOOST_CHECK(bytes_transferred == expected_bytes_transferred);
+ BOOST_ASIO_CHECK(!e);
+ BOOST_ASIO_CHECK(bytes_transferred == expected_bytes_transferred);
 }
 
 void test_4_arg_mutable_buffers_1_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   char read_buf[sizeof(read_data)];
@@ -3420,96 +3435,93 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read_at(s, 1234, buffers,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_4_arg_boost_array_buffers_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   char read_buf[sizeof(read_data)];
@@ -3521,96 +3533,93 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read_at(s, 1234, buffers,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_4_arg_std_array_buffers_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
@@ -3623,97 +3632,93 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read_at(s, 1234, buffers,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_4_arg_vector_buffers_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   char read_buf[sizeof(read_data)];
@@ -3725,96 +3730,92 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read_at(s, 1234, buffers,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_4_arg_streambuf_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::asio::streambuf sb(sizeof(read_data));
@@ -3823,102 +3824,98 @@
   sb.consume(sb.size());
   bool called = false;
   boost::asio::async_read_at(s, 0, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   int i = boost::asio::async_read_at(s, 1234, sb,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 }
 
 void test_5_arg_mutable_buffers_1_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   char read_buf[sizeof(read_data)];
@@ -3930,28 +3927,24 @@
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3959,14 +3952,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3974,14 +3965,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3989,14 +3978,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4004,42 +3991,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4047,14 +4028,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4062,14 +4041,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4077,14 +4054,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4092,42 +4067,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4135,14 +4104,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4150,14 +4117,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4165,14 +4130,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4180,42 +4143,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4223,14 +4180,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4238,14 +4193,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4253,14 +4206,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4268,42 +4219,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4311,14 +4256,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4326,14 +4269,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4341,14 +4282,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4356,42 +4295,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4399,14 +4332,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4414,14 +4345,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4429,14 +4358,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4444,42 +4371,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4487,14 +4408,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4502,14 +4421,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4517,14 +4434,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4532,191 +4447,174 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read_at(s, 1234, buffers,
       short_transfer, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_5_arg_boost_array_buffers_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   char read_buf[sizeof(read_data)];
@@ -4729,28 +4627,24 @@
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4758,14 +4652,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4773,14 +4665,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4788,14 +4678,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4803,42 +4691,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4846,14 +4728,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4861,14 +4741,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4876,14 +4754,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4891,42 +4767,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4934,14 +4804,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4949,14 +4817,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4964,14 +4830,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4979,42 +4843,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5022,14 +4880,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5037,14 +4893,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5052,14 +4906,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5067,42 +4919,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5110,14 +4956,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5125,14 +4969,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5140,14 +4982,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5155,42 +4995,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5198,14 +5032,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5213,14 +5045,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5228,14 +5058,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5243,42 +5071,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5286,14 +5108,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5301,14 +5121,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5316,14 +5134,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5331,191 +5147,174 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read_at(s, 1234, buffers,
       short_transfer, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_5_arg_std_array_buffers_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
@@ -5529,28 +5328,24 @@
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5558,14 +5353,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5573,14 +5366,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5588,14 +5379,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5603,42 +5392,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5646,14 +5429,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5661,14 +5442,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5676,14 +5455,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5691,42 +5468,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5734,14 +5505,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5749,14 +5518,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5764,14 +5531,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5779,42 +5544,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5822,14 +5581,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5837,14 +5594,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5852,14 +5607,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5867,42 +5620,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5910,14 +5657,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5925,14 +5670,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5940,14 +5683,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5955,42 +5696,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5998,14 +5733,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6013,14 +5746,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6028,14 +5759,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6043,42 +5772,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6086,14 +5809,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6101,14 +5822,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6116,14 +5835,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6131,192 +5848,174 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read_at(s, 1234, buffers,
       short_transfer, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_5_arg_vector_buffers_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   char read_buf[sizeof(read_data)];
@@ -6329,28 +6028,24 @@
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6358,14 +6053,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6373,14 +6066,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6388,14 +6079,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6403,42 +6092,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6446,14 +6129,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6461,14 +6142,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6476,14 +6155,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6491,42 +6168,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6534,14 +6205,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6549,14 +6218,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6564,14 +6231,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6579,42 +6244,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6622,14 +6281,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6637,14 +6294,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6652,14 +6307,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6667,42 +6320,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6710,14 +6357,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6725,14 +6370,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6740,14 +6383,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6755,42 +6396,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6798,14 +6433,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6813,14 +6446,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6828,14 +6459,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6843,42 +6472,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6886,14 +6509,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6901,14 +6522,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6916,14 +6535,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6931,191 +6548,173 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   int i = boost::asio::async_read_at(s, 1234, buffers,
       short_transfer, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_5_arg_streambuf_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::asio::streambuf sb(sizeof(read_data));
@@ -7125,30 +6724,26 @@
   bool called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7156,15 +6751,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7172,15 +6765,13 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7188,15 +6779,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7204,45 +6793,39 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7250,15 +6833,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7266,15 +6847,13 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7282,15 +6861,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7298,45 +6875,39 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7344,15 +6915,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7360,15 +6929,13 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7376,15 +6943,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7392,45 +6957,39 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7438,15 +6997,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7454,15 +7011,13 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7470,15 +7025,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7486,45 +7039,39 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 50));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7532,15 +7079,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7548,15 +7093,13 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7564,15 +7107,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7580,45 +7121,39 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7626,15 +7161,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7642,15 +7175,13 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7658,15 +7189,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7674,45 +7203,39 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7720,15 +7243,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7736,15 +7257,13 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7752,15 +7271,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7768,226 +7285,199 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   int i = boost::asio::async_read_at(s, 1234, sb,
       short_transfer, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("read_at");
- test->add(BOOST_TEST_CASE(&test_3_arg_mutable_buffers_1_read_at));
- test->add(BOOST_TEST_CASE(&test_3_arg_vector_buffers_read_at));
- test->add(BOOST_TEST_CASE(&test_3_arg_streambuf_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_nothrow_mutable_buffers_1_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_nothrow_vector_buffers_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_nothrow_streambuf_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_streambuf_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_mutable_buffers_1_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_vector_buffers_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_streambuf_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_async_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_boost_array_buffers_async_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_std_array_buffers_async_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_async_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_streambuf_async_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_mutable_buffers_1_async_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_boost_array_buffers_async_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_std_array_buffers_async_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_vector_buffers_async_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_streambuf_async_read_at));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "read_at",
+ BOOST_ASIO_TEST_CASE(test_3_arg_mutable_buffers_1_read_at)
+ BOOST_ASIO_TEST_CASE(test_3_arg_vector_buffers_read_at)
+ BOOST_ASIO_TEST_CASE(test_3_arg_streambuf_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_nothrow_mutable_buffers_1_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_nothrow_vector_buffers_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_nothrow_streambuf_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_streambuf_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_mutable_buffers_1_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_vector_buffers_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_streambuf_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_boost_array_buffers_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_std_array_buffers_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_streambuf_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_mutable_buffers_1_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_boost_array_buffers_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_std_array_buffers_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_vector_buffers_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_streambuf_async_read_at)
+)

Modified: trunk/libs/asio/test/read_until.cpp
==============================================================================
--- trunk/libs/asio/test/read_until.cpp (original)
+++ trunk/libs/asio/test/read_until.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,17 +16,19 @@
 // Test that header file is self-contained.
 #include <boost/asio/read_until.hpp>
 
-#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
 #include <cstring>
 #include "archetypes/async_result.hpp"
 #include <boost/asio/io_service.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/asio/streambuf.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 class test_stream
- : private boost::noncopyable
 {
 public:
   typedef boost::asio::io_service io_service_type;
@@ -48,7 +50,7 @@
   {
     using namespace std; // For memcpy.
 
- BOOST_CHECK(length <= max_length);
+ BOOST_ASIO_CHECK(length <= max_length);
 
     memcpy(data_, data, length);
     length_ = length;
@@ -110,79 +112,79 @@
   s.reset(read_data, sizeof(read_data));
   sb1.consume(sb1.size());
   std::size_t length = boost::asio::read_until(s, sb1, 'Z');
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, 'Z');
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, 'Z');
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, 'Z', ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, 'Z', ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, 'Z', ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, 'Z', ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, 'Z', ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, 'Z', ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, 'Y', ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, 'Y', ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, 'Y', ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 }
 
 void test_string_read_until()
@@ -196,79 +198,79 @@
   s.reset(read_data, sizeof(read_data));
   sb1.consume(sb1.size());
   std::size_t length = boost::asio::read_until(s, sb1, "XYZ");
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, "XYZ");
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, "XYZ");
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, "XYZ", ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, "XYZ", ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, "XYZ", ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, "XYZ", ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, "XYZ", ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, "XYZ", ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, "WXY", ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, "WXY", ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, "WXY", ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 }
 
 class match_char
@@ -294,7 +296,9 @@
 namespace boost {
 namespace asio {
   template <> struct is_match_condition<match_char>
- : public boost::true_type {};
+ {
+ enum { value = true };
+ };
 } // namespace asio
 } // namespace boost
 
@@ -309,79 +313,79 @@
   s.reset(read_data, sizeof(read_data));
   sb1.consume(sb1.size());
   std::size_t length = boost::asio::read_until(s, sb1, match_char('Z'));
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, match_char('Z'));
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, match_char('Z'));
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, match_char('Z'), ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, match_char('Z'), ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, match_char('Z'), ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, match_char('Z'), ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, match_char('Z'), ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, match_char('Z'), ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, match_char('Y'), ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, match_char('Y'), ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, match_char('Y'), ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 }
 
 void async_read_handler(
@@ -395,6 +399,14 @@
 
 void test_char_async_read_until()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::streambuf sb1;
@@ -409,13 +421,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, 'Z',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -424,13 +436,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, 'Z',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -439,13 +451,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, 'Z',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   ec = boost::system::error_code();
@@ -453,13 +465,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, 'Z',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -468,13 +480,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, 'Z',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -483,13 +495,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, 'Z',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   ec = boost::system::error_code();
@@ -497,13 +509,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, 'Y',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -512,13 +524,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, 'Y',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -527,25 +539,33 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, 'Y',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   sb2.consume(sb2.size());
   int i = boost::asio::async_read_until(s, sb2, 'Y',
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
 }
 
 void test_string_async_read_until()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::streambuf sb1;
@@ -560,13 +580,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, "XYZ",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -575,13 +595,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, "XYZ",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -590,13 +610,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, "XYZ",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   ec = boost::system::error_code();
@@ -604,13 +624,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, "XYZ",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -619,13 +639,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, "XYZ",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -634,13 +654,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, "XYZ",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   ec = boost::system::error_code();
@@ -648,13 +668,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, "WXY",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -663,13 +683,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, "WXY",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -678,25 +698,33 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, "WXY",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   sb2.consume(sb2.size());
   int i = boost::asio::async_read_until(s, sb2, "WXY",
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
 }
 
 void test_match_condition_async_read_until()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::streambuf sb1;
@@ -711,13 +739,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, match_char('Z'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -726,13 +754,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, match_char('Z'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -741,13 +769,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, match_char('Z'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   ec = boost::system::error_code();
@@ -755,13 +783,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, match_char('Z'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -770,13 +798,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, match_char('Z'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -785,13 +813,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, match_char('Z'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   ec = boost::system::error_code();
@@ -799,13 +827,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, match_char('Y'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -814,13 +842,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, match_char('Y'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -829,31 +857,30 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, match_char('Y'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   sb2.consume(sb2.size());
   int i = boost::asio::async_read_until(s, sb2, match_char('Y'),
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("read_until");
- test->add(BOOST_TEST_CASE(&test_char_read_until));
- test->add(BOOST_TEST_CASE(&test_string_read_until));
- test->add(BOOST_TEST_CASE(&test_match_condition_read_until));
- test->add(BOOST_TEST_CASE(&test_char_async_read_until));
- test->add(BOOST_TEST_CASE(&test_string_async_read_until));
- test->add(BOOST_TEST_CASE(&test_match_condition_async_read_until));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "read_until",
+ BOOST_ASIO_TEST_CASE(test_char_read_until)
+ BOOST_ASIO_TEST_CASE(test_string_read_until)
+ BOOST_ASIO_TEST_CASE(test_match_condition_read_until)
+ BOOST_ASIO_TEST_CASE(test_char_async_read_until)
+ BOOST_ASIO_TEST_CASE(test_string_async_read_until)
+ BOOST_ASIO_TEST_CASE(test_match_condition_async_read_until)
+)

Modified: trunk/libs/asio/test/seq_packet_socket_service.cpp
==============================================================================
--- trunk/libs/asio/test/seq_packet_socket_service.cpp (original)
+++ trunk/libs/asio/test/seq_packet_socket_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("seq_packet_socket_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "seq_packet_socket_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/serial_port.cpp
==============================================================================
--- trunk/libs/asio/test/serial_port.cpp (original)
+++ trunk/libs/asio/test/serial_port.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -145,9 +145,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("serial_port");
- test->add(BOOST_TEST_CASE(&serial_port_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "serial_port",
+ BOOST_ASIO_TEST_CASE(serial_port_compile::test)
+)

Modified: trunk/libs/asio/test/serial_port_base.cpp
==============================================================================
--- trunk/libs/asio/test/serial_port_base.cpp (original)
+++ trunk/libs/asio/test/serial_port_base.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -92,9 +92,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("serial_port_base");
- test->add(BOOST_TEST_CASE(&serial_port_base_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "serial_port_base",
+ BOOST_ASIO_TEST_CASE(serial_port_base_compile::test)
+)

Modified: trunk/libs/asio/test/serial_port_service.cpp
==============================================================================
--- trunk/libs/asio/test/serial_port_service.cpp (original)
+++ trunk/libs/asio/test/serial_port_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,9 +19,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("serial_port_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "serial_port_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/signal_set.cpp
==============================================================================
--- trunk/libs/asio/test/signal_set.cpp (original)
+++ trunk/libs/asio/test/signal_set.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -82,9 +82,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("signal_set");
- test->add(BOOST_TEST_CASE(&signal_set_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "signal_set",
+ BOOST_ASIO_TEST_CASE(signal_set_compile::test)
+)

Modified: trunk/libs/asio/test/signal_set_service.cpp
==============================================================================
--- trunk/libs/asio/test/signal_set_service.cpp (original)
+++ trunk/libs/asio/test/signal_set_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("signal_set_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "signal_set_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/socket_acceptor_service.cpp
==============================================================================
--- trunk/libs/asio/test/socket_acceptor_service.cpp (original)
+++ trunk/libs/asio/test/socket_acceptor_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("socket_acceptor_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "socket_acceptor_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/socket_base.cpp
==============================================================================
--- trunk/libs/asio/test/socket_base.cpp (original)
+++ trunk/libs/asio/test/socket_base.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -208,448 +208,447 @@
   // broadcast class.
 
   socket_base::broadcast broadcast1(true);
- BOOST_CHECK(broadcast1.value());
- BOOST_CHECK(static_cast<bool>(broadcast1));
- BOOST_CHECK(!!broadcast1);
+ BOOST_ASIO_CHECK(broadcast1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(broadcast1));
+ BOOST_ASIO_CHECK(!!broadcast1);
   udp_sock.set_option(broadcast1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::broadcast broadcast2;
   udp_sock.get_option(broadcast2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(broadcast2.value());
- BOOST_CHECK(static_cast<bool>(broadcast2));
- BOOST_CHECK(!!broadcast2);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(broadcast2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(broadcast2));
+ BOOST_ASIO_CHECK(!!broadcast2);
 
   socket_base::broadcast broadcast3(false);
- BOOST_CHECK(!broadcast3.value());
- BOOST_CHECK(!static_cast<bool>(broadcast3));
- BOOST_CHECK(!broadcast3);
+ BOOST_ASIO_CHECK(!broadcast3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(broadcast3));
+ BOOST_ASIO_CHECK(!broadcast3);
   udp_sock.set_option(broadcast3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::broadcast broadcast4;
   udp_sock.get_option(broadcast4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!broadcast4.value());
- BOOST_CHECK(!static_cast<bool>(broadcast4));
- BOOST_CHECK(!broadcast4);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!broadcast4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(broadcast4));
+ BOOST_ASIO_CHECK(!broadcast4);
 
   // debug class.
 
   socket_base::debug debug1(true);
- BOOST_CHECK(debug1.value());
- BOOST_CHECK(static_cast<bool>(debug1));
- BOOST_CHECK(!!debug1);
+ BOOST_ASIO_CHECK(debug1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(debug1));
+ BOOST_ASIO_CHECK(!!debug1);
   udp_sock.set_option(debug1, ec);
 #if defined(__linux__)
   // On Linux, only root can set SO_DEBUG.
   bool not_root = (ec == boost::asio::error::access_denied);
- BOOST_CHECK(!ec || not_root);
- BOOST_WARN_MESSAGE(!ec, "Must be root to set debug socket option");
+ BOOST_ASIO_CHECK(!ec || not_root);
+ BOOST_ASIO_WARN_MESSAGE(!ec, "Must be root to set debug socket option");
 #else // defined(__linux__)
-# if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+# if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-# else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-# endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+# else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+# endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 #endif // defined(__linux__)
 
   socket_base::debug debug2;
   udp_sock.get_option(debug2, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 # if defined(__linux__)
- BOOST_CHECK(debug2.value() || not_root);
- BOOST_CHECK(static_cast<bool>(debug2) || not_root);
- BOOST_CHECK(!!debug2 || not_root);
+ BOOST_ASIO_CHECK(debug2.value() || not_root);
+ BOOST_ASIO_CHECK(static_cast<bool>(debug2) || not_root);
+ BOOST_ASIO_CHECK(!!debug2 || not_root);
 # else // defined(__linux__)
- BOOST_CHECK(debug2.value());
- BOOST_CHECK(static_cast<bool>(debug2));
- BOOST_CHECK(!!debug2);
+ BOOST_ASIO_CHECK(debug2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(debug2));
+ BOOST_ASIO_CHECK(!!debug2);
 # endif // defined(__linux__)
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   socket_base::debug debug3(false);
- BOOST_CHECK(!debug3.value());
- BOOST_CHECK(!static_cast<bool>(debug3));
- BOOST_CHECK(!debug3);
+ BOOST_ASIO_CHECK(!debug3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(debug3));
+ BOOST_ASIO_CHECK(!debug3);
   udp_sock.set_option(debug3, ec);
 #if defined(__linux__)
- BOOST_CHECK(!ec || not_root);
+ BOOST_ASIO_CHECK(!ec || not_root);
 #else // defined(__linux__)
-# if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+# if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-# else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-# endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+# else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+# endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 #endif // defined(__linux__)
 
   socket_base::debug debug4;
   udp_sock.get_option(debug4, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 # if defined(__linux__)
- BOOST_CHECK(!debug4.value() || not_root);
- BOOST_CHECK(!static_cast<bool>(debug4) || not_root);
- BOOST_CHECK(!debug4 || not_root);
+ BOOST_ASIO_CHECK(!debug4.value() || not_root);
+ BOOST_ASIO_CHECK(!static_cast<bool>(debug4) || not_root);
+ BOOST_ASIO_CHECK(!debug4 || not_root);
 # else // defined(__linux__)
- BOOST_CHECK(!debug4.value());
- BOOST_CHECK(!static_cast<bool>(debug4));
- BOOST_CHECK(!debug4);
+ BOOST_ASIO_CHECK(!debug4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(debug4));
+ BOOST_ASIO_CHECK(!debug4);
 # endif // defined(__linux__)
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   // do_not_route class.
 
   socket_base::do_not_route do_not_route1(true);
- BOOST_CHECK(do_not_route1.value());
- BOOST_CHECK(static_cast<bool>(do_not_route1));
- BOOST_CHECK(!!do_not_route1);
+ BOOST_ASIO_CHECK(do_not_route1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(do_not_route1));
+ BOOST_ASIO_CHECK(!!do_not_route1);
   udp_sock.set_option(do_not_route1, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   socket_base::do_not_route do_not_route2;
   udp_sock.get_option(do_not_route2, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(do_not_route2.value());
- BOOST_CHECK(static_cast<bool>(do_not_route2));
- BOOST_CHECK(!!do_not_route2);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(do_not_route2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(do_not_route2));
+ BOOST_ASIO_CHECK(!!do_not_route2);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   socket_base::do_not_route do_not_route3(false);
- BOOST_CHECK(!do_not_route3.value());
- BOOST_CHECK(!static_cast<bool>(do_not_route3));
- BOOST_CHECK(!do_not_route3);
+ BOOST_ASIO_CHECK(!do_not_route3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(do_not_route3));
+ BOOST_ASIO_CHECK(!do_not_route3);
   udp_sock.set_option(do_not_route3, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   socket_base::do_not_route do_not_route4;
   udp_sock.get_option(do_not_route4, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!do_not_route4.value());
- BOOST_CHECK(!static_cast<bool>(do_not_route4));
- BOOST_CHECK(!do_not_route4);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!do_not_route4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(do_not_route4));
+ BOOST_ASIO_CHECK(!do_not_route4);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   // keep_alive class.
 
   socket_base::keep_alive keep_alive1(true);
- BOOST_CHECK(keep_alive1.value());
- BOOST_CHECK(static_cast<bool>(keep_alive1));
- BOOST_CHECK(!!keep_alive1);
+ BOOST_ASIO_CHECK(keep_alive1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(keep_alive1));
+ BOOST_ASIO_CHECK(!!keep_alive1);
   tcp_sock.set_option(keep_alive1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::keep_alive keep_alive2;
   tcp_sock.get_option(keep_alive2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(keep_alive2.value());
- BOOST_CHECK(static_cast<bool>(keep_alive2));
- BOOST_CHECK(!!keep_alive2);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(keep_alive2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(keep_alive2));
+ BOOST_ASIO_CHECK(!!keep_alive2);
 
   socket_base::keep_alive keep_alive3(false);
- BOOST_CHECK(!keep_alive3.value());
- BOOST_CHECK(!static_cast<bool>(keep_alive3));
- BOOST_CHECK(!keep_alive3);
+ BOOST_ASIO_CHECK(!keep_alive3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(keep_alive3));
+ BOOST_ASIO_CHECK(!keep_alive3);
   tcp_sock.set_option(keep_alive3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::keep_alive keep_alive4;
   tcp_sock.get_option(keep_alive4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!keep_alive4.value());
- BOOST_CHECK(!static_cast<bool>(keep_alive4));
- BOOST_CHECK(!keep_alive4);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!keep_alive4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(keep_alive4));
+ BOOST_ASIO_CHECK(!keep_alive4);
 
   // send_buffer_size class.
 
   socket_base::send_buffer_size send_buffer_size1(4096);
- BOOST_CHECK(send_buffer_size1.value() == 4096);
+ BOOST_ASIO_CHECK(send_buffer_size1.value() == 4096);
   tcp_sock.set_option(send_buffer_size1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::send_buffer_size send_buffer_size2;
   tcp_sock.get_option(send_buffer_size2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(send_buffer_size2.value() == 4096);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(send_buffer_size2.value() == 4096);
 
   socket_base::send_buffer_size send_buffer_size3(16384);
- BOOST_CHECK(send_buffer_size3.value() == 16384);
+ BOOST_ASIO_CHECK(send_buffer_size3.value() == 16384);
   tcp_sock.set_option(send_buffer_size3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::send_buffer_size send_buffer_size4;
   tcp_sock.get_option(send_buffer_size4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(send_buffer_size4.value() == 16384);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(send_buffer_size4.value() == 16384);
 
   // send_low_watermark class.
 
   socket_base::send_low_watermark send_low_watermark1(4096);
- BOOST_CHECK(send_low_watermark1.value() == 4096);
+ BOOST_ASIO_CHECK(send_low_watermark1.value() == 4096);
   tcp_sock.set_option(send_low_watermark1, ec);
 #if defined(WIN32) || defined(__linux__) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows, Linux or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows, Linux or Solaris.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 #endif
 
   socket_base::send_low_watermark send_low_watermark2;
   tcp_sock.get_option(send_low_watermark2, ec);
 #if defined(WIN32) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows or Solaris.
 #elif defined(__linux__)
- BOOST_CHECK(!ec); // Not supported on Linux but can get value.
+ BOOST_ASIO_CHECK(!ec); // Not supported on Linux but can get value.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(send_low_watermark2.value() == 4096);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(send_low_watermark2.value() == 4096);
 #endif
 
   socket_base::send_low_watermark send_low_watermark3(8192);
- BOOST_CHECK(send_low_watermark3.value() == 8192);
+ BOOST_ASIO_CHECK(send_low_watermark3.value() == 8192);
   tcp_sock.set_option(send_low_watermark3, ec);
 #if defined(WIN32) || defined(__linux__) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows, Linux or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows, Linux or Solaris.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 #endif
 
   socket_base::send_low_watermark send_low_watermark4;
   tcp_sock.get_option(send_low_watermark4, ec);
 #if defined(WIN32) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows or Solaris.
 #elif defined(__linux__)
- BOOST_CHECK(!ec); // Not supported on Linux but can get value.
+ BOOST_ASIO_CHECK(!ec); // Not supported on Linux but can get value.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(send_low_watermark4.value() == 8192);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(send_low_watermark4.value() == 8192);
 #endif
 
   // receive_buffer_size class.
 
   socket_base::receive_buffer_size receive_buffer_size1(4096);
- BOOST_CHECK(receive_buffer_size1.value() == 4096);
+ BOOST_ASIO_CHECK(receive_buffer_size1.value() == 4096);
   tcp_sock.set_option(receive_buffer_size1, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   socket_base::receive_buffer_size receive_buffer_size2;
   tcp_sock.get_option(receive_buffer_size2, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK(!ec); // Not supported under Windows CE but can get value.
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(receive_buffer_size2.value() == 4096);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK(!ec); // Not supported under Windows CE but can get value.
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(receive_buffer_size2.value() == 4096);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   socket_base::receive_buffer_size receive_buffer_size3(16384);
- BOOST_CHECK(receive_buffer_size3.value() == 16384);
+ BOOST_ASIO_CHECK(receive_buffer_size3.value() == 16384);
   tcp_sock.set_option(receive_buffer_size3, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   socket_base::receive_buffer_size receive_buffer_size4;
   tcp_sock.get_option(receive_buffer_size4, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK(!ec); // Not supported under Windows CE but can get value.
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(receive_buffer_size4.value() == 16384);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK(!ec); // Not supported under Windows CE but can get value.
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(receive_buffer_size4.value() == 16384);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   // receive_low_watermark class.
 
   socket_base::receive_low_watermark receive_low_watermark1(4096);
- BOOST_CHECK(receive_low_watermark1.value() == 4096);
+ BOOST_ASIO_CHECK(receive_low_watermark1.value() == 4096);
   tcp_sock.set_option(receive_low_watermark1, ec);
 #if defined(WIN32) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows or Solaris.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 #endif
 
   socket_base::receive_low_watermark receive_low_watermark2;
   tcp_sock.get_option(receive_low_watermark2, ec);
 #if defined(WIN32) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows or Solaris.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(receive_low_watermark2.value() == 4096);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(receive_low_watermark2.value() == 4096);
 #endif
 
   socket_base::receive_low_watermark receive_low_watermark3(8192);
- BOOST_CHECK(receive_low_watermark3.value() == 8192);
+ BOOST_ASIO_CHECK(receive_low_watermark3.value() == 8192);
   tcp_sock.set_option(receive_low_watermark3, ec);
 #if defined(WIN32) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows or Solaris.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 #endif
 
   socket_base::receive_low_watermark receive_low_watermark4;
   tcp_sock.get_option(receive_low_watermark4, ec);
 #if defined(WIN32) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows or Solaris.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(receive_low_watermark4.value() == 8192);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(receive_low_watermark4.value() == 8192);
 #endif
 
   // reuse_address class.
 
   socket_base::reuse_address reuse_address1(true);
- BOOST_CHECK(reuse_address1.value());
- BOOST_CHECK(static_cast<bool>(reuse_address1));
- BOOST_CHECK(!!reuse_address1);
+ BOOST_ASIO_CHECK(reuse_address1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(reuse_address1));
+ BOOST_ASIO_CHECK(!!reuse_address1);
   udp_sock.set_option(reuse_address1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::reuse_address reuse_address2;
   udp_sock.get_option(reuse_address2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(reuse_address2.value());
- BOOST_CHECK(static_cast<bool>(reuse_address2));
- BOOST_CHECK(!!reuse_address2);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(reuse_address2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(reuse_address2));
+ BOOST_ASIO_CHECK(!!reuse_address2);
 
   socket_base::reuse_address reuse_address3(false);
- BOOST_CHECK(!reuse_address3.value());
- BOOST_CHECK(!static_cast<bool>(reuse_address3));
- BOOST_CHECK(!reuse_address3);
+ BOOST_ASIO_CHECK(!reuse_address3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(reuse_address3));
+ BOOST_ASIO_CHECK(!reuse_address3);
   udp_sock.set_option(reuse_address3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::reuse_address reuse_address4;
   udp_sock.get_option(reuse_address4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!reuse_address4.value());
- BOOST_CHECK(!static_cast<bool>(reuse_address4));
- BOOST_CHECK(!reuse_address4);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!reuse_address4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(reuse_address4));
+ BOOST_ASIO_CHECK(!reuse_address4);
 
   // linger class.
 
   socket_base::linger linger1(true, 60);
- BOOST_CHECK(linger1.enabled());
- BOOST_CHECK(linger1.timeout() == 60);
+ BOOST_ASIO_CHECK(linger1.enabled());
+ BOOST_ASIO_CHECK(linger1.timeout() == 60);
   tcp_sock.set_option(linger1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::linger linger2;
   tcp_sock.get_option(linger2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(linger2.enabled());
- BOOST_CHECK(linger2.timeout() == 60);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(linger2.enabled());
+ BOOST_ASIO_CHECK(linger2.timeout() == 60);
 
   socket_base::linger linger3(false, 0);
- BOOST_CHECK(!linger3.enabled());
- BOOST_CHECK(linger3.timeout() == 0);
+ BOOST_ASIO_CHECK(!linger3.enabled());
+ BOOST_ASIO_CHECK(linger3.timeout() == 0);
   tcp_sock.set_option(linger3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::linger linger4;
   tcp_sock.get_option(linger4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!linger4.enabled());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!linger4.enabled());
 
   // enable_connection_aborted class.
 
   socket_base::enable_connection_aborted enable_connection_aborted1(true);
- BOOST_CHECK(enable_connection_aborted1.value());
- BOOST_CHECK(static_cast<bool>(enable_connection_aborted1));
- BOOST_CHECK(!!enable_connection_aborted1);
+ BOOST_ASIO_CHECK(enable_connection_aborted1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(enable_connection_aborted1));
+ BOOST_ASIO_CHECK(!!enable_connection_aborted1);
   tcp_acceptor.set_option(enable_connection_aborted1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::enable_connection_aborted enable_connection_aborted2;
   tcp_acceptor.get_option(enable_connection_aborted2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(enable_connection_aborted2.value());
- BOOST_CHECK(static_cast<bool>(enable_connection_aborted2));
- BOOST_CHECK(!!enable_connection_aborted2);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(enable_connection_aborted2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(enable_connection_aborted2));
+ BOOST_ASIO_CHECK(!!enable_connection_aborted2);
 
   socket_base::enable_connection_aborted enable_connection_aborted3(false);
- BOOST_CHECK(!enable_connection_aborted3.value());
- BOOST_CHECK(!static_cast<bool>(enable_connection_aborted3));
- BOOST_CHECK(!enable_connection_aborted3);
+ BOOST_ASIO_CHECK(!enable_connection_aborted3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(enable_connection_aborted3));
+ BOOST_ASIO_CHECK(!enable_connection_aborted3);
   tcp_acceptor.set_option(enable_connection_aborted3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::enable_connection_aborted enable_connection_aborted4;
   tcp_acceptor.get_option(enable_connection_aborted4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!enable_connection_aborted4.value());
- BOOST_CHECK(!static_cast<bool>(enable_connection_aborted4));
- BOOST_CHECK(!enable_connection_aborted4);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!enable_connection_aborted4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(enable_connection_aborted4));
+ BOOST_ASIO_CHECK(!enable_connection_aborted4);
 
   // non_blocking_io class.
 
   socket_base::non_blocking_io non_blocking_io1(true);
   tcp_sock.io_control(non_blocking_io1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::non_blocking_io non_blocking_io2(false);
   tcp_sock.io_control(non_blocking_io2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   // bytes_readable class.
 
   socket_base::bytes_readable bytes_readable;
   udp_sock.io_control(bytes_readable, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 }
 
 } // namespace socket_base_runtime
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("socket_base");
- test->add(BOOST_TEST_CASE(&socket_base_compile::test));
- test->add(BOOST_TEST_CASE(&socket_base_runtime::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "socket_base",
+ BOOST_ASIO_TEST_CASE(socket_base_compile::test)
+ BOOST_ASIO_TEST_CASE(socket_base_runtime::test)
+)

Modified: trunk/libs/asio/test/ssl/basic_context.cpp
==============================================================================
--- trunk/libs/asio/test/ssl/basic_context.cpp (original)
+++ trunk/libs/asio/test/ssl/basic_context.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/basic_context");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/basic_context",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/ssl/context.cpp
==============================================================================
--- trunk/libs/asio/test/ssl/context.cpp (original)
+++ trunk/libs/asio/test/ssl/context.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/context");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/context",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/ssl/context_base.cpp
==============================================================================
--- trunk/libs/asio/test/ssl/context_base.cpp (original)
+++ trunk/libs/asio/test/ssl/context_base.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/context_base");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/context_base",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/ssl/context_service.cpp
==============================================================================
--- trunk/libs/asio/test/ssl/context_service.cpp (original)
+++ trunk/libs/asio/test/ssl/context_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/context_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/context_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/ssl/rfc2818_verification.cpp
==============================================================================
--- trunk/libs/asio/test/ssl/rfc2818_verification.cpp (original)
+++ trunk/libs/asio/test/ssl/rfc2818_verification.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/rfc2818_verification");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/rfc2818_verification",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/ssl/stream.cpp
==============================================================================
--- trunk/libs/asio/test/ssl/stream.cpp (original)
+++ trunk/libs/asio/test/ssl/stream.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -162,9 +162,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/stream");
- test->add(BOOST_TEST_CASE(&ssl_stream_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/stream",
+ BOOST_ASIO_TEST_CASE(ssl_stream_compile::test)
+)

Modified: trunk/libs/asio/test/ssl/stream_base.cpp
==============================================================================
--- trunk/libs/asio/test/ssl/stream_base.cpp (original)
+++ trunk/libs/asio/test/ssl/stream_base.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/stream_base");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/stream_base",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/ssl/stream_service.cpp
==============================================================================
--- trunk/libs/asio/test/ssl/stream_service.cpp (original)
+++ trunk/libs/asio/test/ssl/stream_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/stream_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/stream_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/steady_timer.cpp
==============================================================================
--- trunk/libs/asio/test/steady_timer.cpp (original)
+++ trunk/libs/asio/test/steady_timer.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -23,9 +23,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("steady_timer");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "steady_timer",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/strand.cpp
==============================================================================
--- trunk/libs/asio/test/strand.cpp (original)
+++ trunk/libs/asio/test/strand.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -17,14 +17,41 @@
 #include <boost/asio/strand.hpp>
 
 #include <sstream>
-#include <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
-#include <boost/asio/deadline_timer.hpp>
 #include <boost/asio/io_service.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/deadline_timer.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/steady_timer.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/thread/thread.hpp>
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 using namespace boost::asio;
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+namespace bindns = std;
+#endif
+
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+typedef deadline_timer timer;
+namespace chronons = boost::posix_time;
+#elif defined(BOOST_ASIO_HAS_STD_CHRONO)
+typedef steady_timer timer;
+namespace chronons = std::chrono;
+#elif defined(BOOST_ASIO_HAS_BOOST_CHRONO)
+typedef steady_timer timer;
+namespace chronons = boost::chrono;
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
 void increment(int* count)
 {
   ++(*count);
@@ -32,33 +59,33 @@
 
 void increment_without_lock(strand* s, int* count)
 {
- BOOST_CHECK(!s->running_in_this_thread());
+ BOOST_ASIO_CHECK(!s->running_in_this_thread());
 
   int original_count = *count;
 
- s->dispatch(boost::bind(increment, count));
+ s->dispatch(bindns::bind(increment, count));
 
   // No other functions are currently executing through the locking dispatcher,
   // so the previous call to dispatch should have successfully nested.
- BOOST_CHECK(*count == original_count + 1);
+ BOOST_ASIO_CHECK(*count == original_count + 1);
 }
 
 void increment_with_lock(strand* s, int* count)
 {
- BOOST_CHECK(s->running_in_this_thread());
+ BOOST_ASIO_CHECK(s->running_in_this_thread());
 
   int original_count = *count;
 
- s->dispatch(boost::bind(increment, count));
+ s->dispatch(bindns::bind(increment, count));
 
   // The current function already holds the strand's lock, so the
   // previous call to dispatch should have successfully nested.
- BOOST_CHECK(*count == original_count + 1);
+ BOOST_ASIO_CHECK(*count == original_count + 1);
 }
 
 void sleep_increment(io_service* ios, int* count)
 {
- deadline_timer t(*ios, boost::posix_time::seconds(2));
+ timer t(*ios, chronons::seconds(2));
   t.wait();
 
   ++(*count);
@@ -67,13 +94,13 @@
 void start_sleep_increments(io_service* ios, strand* s, int* count)
 {
   // Give all threads a chance to start.
- deadline_timer t(*ios, boost::posix_time::seconds(2));
+ timer t(*ios, chronons::seconds(2));
   t.wait();
 
   // Start three increments.
- s->post(boost::bind(sleep_increment, ios, count));
- s->post(boost::bind(sleep_increment, ios, count));
- s->post(boost::bind(sleep_increment, ios, count));
+ s->post(bindns::bind(sleep_increment, ios, count));
+ s->post(bindns::bind(sleep_increment, ios, count));
+ s->post(bindns::bind(sleep_increment, ios, count));
 }
 
 void throw_exception()
@@ -92,63 +119,63 @@
   strand s(ios);
   int count = 0;
 
- ios.post(boost::bind(increment_without_lock, &s, &count));
+ ios.post(bindns::bind(increment_without_lock, &s, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(count == 1);
 
   count = 0;
   ios.reset();
- s.post(boost::bind(increment_with_lock, &s, &count));
+ s.post(bindns::bind(increment_with_lock, &s, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(count == 1);
 
   count = 0;
   ios.reset();
- ios.post(boost::bind(start_sleep_increments, &ios, &s, &count));
- boost::thread thread1(boost::bind(io_service_run, &ios));
- boost::thread thread2(boost::bind(io_service_run, &ios));
+ ios.post(bindns::bind(start_sleep_increments, &ios, &s, &count));
+ boost::thread thread1(bindns::bind(io_service_run, &ios));
+ boost::thread thread2(bindns::bind(io_service_run, &ios));
 
   // Check all events run one after another even though there are two threads.
- deadline_timer timer1(ios, boost::posix_time::seconds(3));
+ timer timer1(ios, chronons::seconds(3));
   timer1.wait();
- BOOST_CHECK(count == 0);
- timer1.expires_at(timer1.expires_at() + boost::posix_time::seconds(2));
+ BOOST_ASIO_CHECK(count == 0);
+ timer1.expires_at(timer1.expires_at() + chronons::seconds(2));
   timer1.wait();
- BOOST_CHECK(count == 1);
- timer1.expires_at(timer1.expires_at() + boost::posix_time::seconds(2));
+ BOOST_ASIO_CHECK(count == 1);
+ timer1.expires_at(timer1.expires_at() + chronons::seconds(2));
   timer1.wait();
- BOOST_CHECK(count == 2);
+ BOOST_ASIO_CHECK(count == 2);
 
   thread1.join();
   thread2.join();
 
   // The run() calls will not return until all work has finished.
- BOOST_CHECK(count == 3);
+ BOOST_ASIO_CHECK(count == 3);
 
   count = 0;
   int exception_count = 0;
   ios.reset();
   s.post(throw_exception);
- s.post(boost::bind(increment, &count));
- s.post(boost::bind(increment, &count));
+ s.post(bindns::bind(increment, &count));
+ s.post(bindns::bind(increment, &count));
   s.post(throw_exception);
- s.post(boost::bind(increment, &count));
+ s.post(bindns::bind(increment, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(count == 0);
- BOOST_CHECK(exception_count == 0);
+ BOOST_ASIO_CHECK(count == 0);
+ BOOST_ASIO_CHECK(exception_count == 0);
 
   for (;;)
   {
@@ -164,8 +191,8 @@
   }
 
   // The run() calls will not return until all work has finished.
- BOOST_CHECK(count == 3);
- BOOST_CHECK(exception_count == 2);
+ BOOST_ASIO_CHECK(count == 3);
+ BOOST_ASIO_CHECK(exception_count == 2);
 
   count = 0;
   ios.reset();
@@ -174,18 +201,17 @@
   // are abandoned.
   {
     strand s2(ios);
- s2.post(boost::bind(increment, &count));
- s2.post(boost::bind(increment, &count));
- s2.post(boost::bind(increment, &count));
+ s2.post(bindns::bind(increment, &count));
+ s2.post(bindns::bind(increment, &count));
+ s2.post(bindns::bind(increment, &count));
   }
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("strand");
- test->add(BOOST_TEST_CASE(&strand_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "strand",
+ BOOST_ASIO_TEST_CASE(strand_test)
+)

Modified: trunk/libs/asio/test/stream_socket_service.cpp
==============================================================================
--- trunk/libs/asio/test/stream_socket_service.cpp (original)
+++ trunk/libs/asio/test/stream_socket_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("stream_socket_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "stream_socket_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/streambuf.cpp
==============================================================================
--- trunk/libs/asio/test/streambuf.cpp (original)
+++ trunk/libs/asio/test/streambuf.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -25,39 +25,38 @@
 
   sb.sputn("abcd", 4);
 
- BOOST_CHECK(sb.size() == 4);
+ BOOST_ASIO_CHECK(sb.size() == 4);
 
   for (int i = 0; i < 100; ++i)
   {
     sb.consume(3);
 
- BOOST_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
 
     char buf[1];
     sb.sgetn(buf, 1);
 
- BOOST_CHECK(sb.size() == 0);
+ BOOST_ASIO_CHECK(sb.size() == 0);
 
     sb.sputn("ab", 2);
 
- BOOST_CHECK(sb.size() == 2);
+ BOOST_ASIO_CHECK(sb.size() == 2);
 
     boost::asio::buffer_copy(sb.prepare(10), boost::asio::buffer("cd", 2));
     sb.commit(2);
 
- BOOST_CHECK(sb.size() == 4);
+ BOOST_ASIO_CHECK(sb.size() == 4);
   }
 
- BOOST_CHECK(sb.size() == 4);
+ BOOST_ASIO_CHECK(sb.size() == 4);
 
   sb.consume(4);
 
- BOOST_CHECK(sb.size() == 0);
+ BOOST_ASIO_CHECK(sb.size() == 0);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("streambuf");
- test->add(BOOST_TEST_CASE(&streambuf_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "streambuf",
+ BOOST_ASIO_TEST_CASE(streambuf_test)
+)

Modified: trunk/libs/asio/test/system_timer.cpp
==============================================================================
--- trunk/libs/asio/test/system_timer.cpp (original)
+++ trunk/libs/asio/test/system_timer.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -23,9 +23,337 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
+#if defined(BOOST_ASIO_HAS_STD_CHRONO)
+
+#include <boost/asio/io_service.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/thread/thread.hpp>
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+namespace bindns = std;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+namespace chronons = std::chrono;
+
+void increment(int* count)
+{
+ ++(*count);
+}
+
+void decrement_to_zero(boost::asio::system_timer* t, int* count)
+{
+ if (*count > 0)
+ {
+ --(*count);
+
+ int before_value = *count;
+
+ t->expires_at(t->expires_at() + chronons::seconds(1));
+ t->async_wait(bindns::bind(decrement_to_zero, t, count));
+
+ // Completion cannot nest, so count value should remain unchanged.
+ BOOST_ASIO_CHECK(*count == before_value);
+ }
+}
+
+void increment_if_not_cancelled(int* count,
+ const boost::system::error_code& ec)
+{
+ if (!ec)
+ ++(*count);
+}
+
+void cancel_timer(boost::asio::system_timer* t)
+{
+ std::size_t num_cancelled = t->cancel();
+ BOOST_ASIO_CHECK(num_cancelled == 1);
+}
+
+void cancel_one_timer(boost::asio::system_timer* t)
+{
+ std::size_t num_cancelled = t->cancel_one();
+ BOOST_ASIO_CHECK(num_cancelled == 1);
+}
+
+boost::asio::system_timer::time_point now()
+{
+ return boost::asio::system_timer::clock_type::now();
+}
+
+void system_timer_test()
+{
+ using chronons::seconds;
+ using chronons::microseconds;
+#if !defined(BOOST_ASIO_HAS_BOOST_BIND)
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // !defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+ boost::asio::io_service ios;
+ int count = 0;
+
+ boost::asio::system_timer::time_point start = now();
+
+ boost::asio::system_timer t1(ios, seconds(1));
+ t1.wait();
+
+ // The timer must block until after its expiry time.
+ boost::asio::system_timer::time_point end = now();
+ boost::asio::system_timer::time_point expected_end = start + seconds(1);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+
+ start = now();
+
+ boost::asio::system_timer t2(ios, seconds(1) + microseconds(500000));
+ t2.wait();
+
+ // The timer must block until after its expiry time.
+ end = now();
+ expected_end = start + seconds(1) + microseconds(500000);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+
+ t2.expires_at(t2.expires_at() + seconds(1));
+ t2.wait();
+
+ // The timer must block until after its expiry time.
+ end = now();
+ expected_end += seconds(1);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+
+ start = now();
+
+ t2.expires_from_now(seconds(1) + microseconds(200000));
+ t2.wait();
+
+ // The timer must block until after its expiry time.
+ end = now();
+ expected_end = start + seconds(1) + microseconds(200000);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+
+ start = now();
+
+ boost::asio::system_timer t3(ios, seconds(5));
+ t3.async_wait(bindns::bind(increment, &count));
+
+ // No completions can be delivered until run() is called.
+ BOOST_ASIO_CHECK(count == 0);
+
+ ios.run();
+
+ // The run() call will not return until all operations have finished, and
+ // this should not be until after the timer's expiry time.
+ BOOST_ASIO_CHECK(count == 1);
+ end = now();
+ expected_end = start + seconds(1);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+
+ count = 3;
+ start = now();
+
+ boost::asio::system_timer t4(ios, seconds(1));
+ t4.async_wait(bindns::bind(decrement_to_zero, &t4, &count));
+
+ // No completions can be delivered until run() is called.
+ BOOST_ASIO_CHECK(count == 3);
+
+ ios.reset();
+ ios.run();
+
+ // The run() call will not return until all operations have finished, and
+ // this should not be until after the timer's final expiry time.
+ BOOST_ASIO_CHECK(count == 0);
+ end = now();
+ expected_end = start + seconds(3);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+
+ count = 0;
+ start = now();
+
+ boost::asio::system_timer t5(ios, seconds(10));
+ t5.async_wait(bindns::bind(increment_if_not_cancelled, &count, _1));
+ boost::asio::system_timer t6(ios, seconds(1));
+ t6.async_wait(bindns::bind(cancel_timer, &t5));
+
+ // No completions can be delivered until run() is called.
+ BOOST_ASIO_CHECK(count == 0);
+
+ ios.reset();
+ ios.run();
+
+ // The timer should have been cancelled, so count should not have changed.
+ // The total run time should not have been much more than 1 second (and
+ // certainly far less than 10 seconds).
+ BOOST_ASIO_CHECK(count == 0);
+ end = now();
+ expected_end = start + seconds(2);
+ BOOST_ASIO_CHECK(end < expected_end);
+
+ // Wait on the timer again without cancelling it. This time the asynchronous
+ // wait should run to completion and increment the counter.
+ t5.async_wait(bindns::bind(increment_if_not_cancelled, &count, _1));
+
+ ios.reset();
+ ios.run();
+
+ // The timer should not have been cancelled, so count should have changed.
+ // The total time since the timer was created should be more than 10 seconds.
+ BOOST_ASIO_CHECK(count == 1);
+ end = now();
+ expected_end = start + seconds(10);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+
+ count = 0;
+ start = now();
+
+ // Start two waits on a timer, one of which will be cancelled. The one
+ // which is not cancelled should still run to completion and increment the
+ // counter.
+ boost::asio::system_timer t7(ios, seconds(3));
+ t7.async_wait(bindns::bind(increment_if_not_cancelled, &count, _1));
+ t7.async_wait(bindns::bind(increment_if_not_cancelled, &count, _1));
+ boost::asio::system_timer t8(ios, seconds(1));
+ t8.async_wait(bindns::bind(cancel_one_timer, &t7));
+
+ ios.reset();
+ ios.run();
+
+ // One of the waits should not have been cancelled, so count should have
+ // changed. The total time since the timer was created should be more than 3
+ // seconds.
+ BOOST_ASIO_CHECK(count == 1);
+ end = now();
+ expected_end = start + seconds(3);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+}
+
+void timer_handler(const boost::system::error_code&)
+{
+}
+
+void system_timer_cancel_test()
+{
+ static boost::asio::io_service io_service;
+ struct timer
+ {
+ boost::asio::system_timer t;
+ timer() : t(io_service)
+ {
+ t.expires_at(boost::asio::system_timer::time_point::max());
+ }
+ } timers[50];
+
+ timers[2].t.async_wait(&timer_handler);
+ timers[41].t.async_wait(&timer_handler);
+ for (int i = 10; i < 20; ++i)
+ timers[i].t.async_wait(&timer_handler);
+
+ BOOST_ASIO_CHECK(timers[2].t.cancel() == 1);
+ BOOST_ASIO_CHECK(timers[41].t.cancel() == 1);
+ for (int i = 10; i < 20; ++i)
+ BOOST_ASIO_CHECK(timers[i].t.cancel() == 1);
+}
+
+struct custom_allocation_timer_handler
 {
- test_suite* test = BOOST_TEST_SUITE("system_timer");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
+ custom_allocation_timer_handler(int* count) : count_(count) {}
+ void operator()(const boost::system::error_code&) {}
+ int* count_;
+};
+
+void* asio_handler_allocate(std::size_t size,
+ custom_allocation_timer_handler* handler)
+{
+ ++(*handler->count_);
+ return ::operator new(size);
 }
+
+void asio_handler_deallocate(void* pointer, std::size_t,
+ custom_allocation_timer_handler* handler)
+{
+ --(*handler->count_);
+ ::operator delete(pointer);
+}
+
+void system_timer_custom_allocation_test()
+{
+ static boost::asio::io_service io_service;
+ struct timer
+ {
+ boost::asio::system_timer t;
+ timer() : t(io_service) {}
+ } timers[100];
+
+ int allocation_count = 0;
+
+ for (int i = 0; i < 50; ++i)
+ {
+ timers[i].t.expires_at(boost::asio::system_timer::time_point::max());
+ timers[i].t.async_wait(custom_allocation_timer_handler(&allocation_count));
+ }
+
+ for (int i = 50; i < 100; ++i)
+ {
+ timers[i].t.expires_at(boost::asio::system_timer::time_point());
+ timers[i].t.async_wait(custom_allocation_timer_handler(&allocation_count));
+ }
+
+ for (int i = 0; i < 50; ++i)
+ timers[i].t.cancel();
+
+ io_service.run();
+
+ BOOST_ASIO_CHECK(allocation_count == 0);
+}
+
+void io_service_run(boost::asio::io_service* ios)
+{
+ ios->run();
+}
+
+void system_timer_thread_test()
+{
+ boost::asio::io_service ios;
+ boost::asio::io_service::work w(ios);
+ boost::asio::system_timer t1(ios);
+ boost::asio::system_timer t2(ios);
+ int count = 0;
+
+ boost::thread th(bindns::bind(io_service_run, &ios));
+
+ t2.expires_from_now(chronons::seconds(2));
+ t2.wait();
+
+ t1.expires_from_now(chronons::seconds(2));
+ t1.async_wait(bindns::bind(increment, &count));
+
+ t2.expires_from_now(chronons::seconds(4));
+ t2.wait();
+
+ ios.stop();
+ th.join();
+
+ BOOST_ASIO_CHECK(count == 1);
+}
+
+BOOST_ASIO_TEST_SUITE
+(
+ "system_timer",
+ BOOST_ASIO_TEST_CASE(system_timer_test)
+ BOOST_ASIO_TEST_CASE(system_timer_cancel_test)
+ BOOST_ASIO_TEST_CASE(system_timer_custom_allocation_test)
+ BOOST_ASIO_TEST_CASE(system_timer_thread_test)
+)
+#else // defined(BOOST_ASIO_HAS_STD_CHRONO)
+BOOST_ASIO_TEST_SUITE
+(
+ "system_timer",
+ BOOST_ASIO_TEST_CASE(null_test)
+)
+#endif // defined(BOOST_ASIO_HAS_STD_CHRONO)

Modified: trunk/libs/asio/test/time_traits.cpp
==============================================================================
--- trunk/libs/asio/test/time_traits.cpp (original)
+++ trunk/libs/asio/test/time_traits.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("time_traits");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "time_traits",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/unit_test.hpp
==============================================================================
--- trunk/libs/asio/test/unit_test.hpp (original)
+++ trunk/libs/asio/test/unit_test.hpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -11,7 +11,7 @@
 #ifndef UNIT_TEST_HPP
 #define UNIT_TEST_HPP
 
-#include <boost/config.hpp>
+#include <boost/asio/detail/config.hpp>
 
 #if defined(__sun)
 # include <stdlib.h> // Needed for lrand48.
@@ -28,18 +28,73 @@
 
 #endif // defined(__BORLANDC__)
 
-#if defined(BOOST_MSVC)
+#if defined(BOOST_ASIO_MSVC)
 # pragma warning (push)
 # pragma warning (disable:4244)
 # pragma warning (disable:4702)
-#endif // defined(BOOST_MSVC)
+#endif // defined(BOOST_ASIO_MSVC)
+
+#if defined(BOOST_ASIO_STANDALONE)
+
+#include <cassert>
+#include <iostream>
+
+#if defined(NDEBUG)
+# error NDEBUG must not be defined when building these unit tests
+#endif // defined(NDEBUG)
+
+#define BOOST_ASIO_CHECK(expr) assert(expr)
+
+#define BOOST_ASIO_CHECK_MESSAGE(expr, msg) \
+ do { if (!(expr)) { std::cout << msg << std::endl; assert(expr); } } while (0)
+
+#define BOOST_ASIO_WARN_MESSAGE(expr, msg) \
+ do { if (!(expr)) { std::cout << msg << std::endl; } } while (0)
+
+#define BOOST_ASIO_ERROR(msg) assert(0 && msg)
+
+#define BOOST_ASIO_TEST_SUITE(name, tests) \
+ int main() \
+ { \
+ std::cout << name << " test suite begins" << std::endl; \
+ tests \
+ std::cout << name << " test suite ends" << std::endl; \
+ return 0; \
+ }
+
+#define BOOST_ASIO_TEST_CASE(test) \
+ test(); \
+ std::cout << #test << " passed" << std::endl;
+
+#else // defined(BOOST_ASIO_STANDALONE)
 
 #include <boost/test/unit_test.hpp>
 using boost::unit_test::test_suite;
 
-#if defined(BOOST_MSVC)
+#define BOOST_ASIO_CHECK(expr) BOOST_CHECK(expr)
+
+#define BOOST_ASIO_CHECK_MESSAGE(expr, msg) BOOST_CHECK_MESSAGE(expr, msg)
+
+#define BOOST_ASIO_WARN_MESSAGE(expr, msg) BOOST_WARN_MESSAGE(expr, msg)
+
+#define BOOST_ASIO_ERROR(expr) BOOST_ERROR(expr)
+
+#define BOOST_ASIO_TEST_SUITE(name, tests) \
+ test_suite* init_unit_test_suite(int, char*[]) \
+ { \
+ test_suite* t = BOOST_TEST_SUITE(name); \
+ tests \
+ return t; \
+ }
+
+#define BOOST_ASIO_TEST_CASE(test) \
+ t->add(BOOST_TEST_CASE(&test));
+
+#endif // defined(BOOST_ASIO_STANDALONE)
+
+#if defined(BOOST_ASIO_MSVC)
 # pragma warning (pop)
-#endif // defined(BOOST_MSVC)
+#endif // defined(BOOST_ASIO_MSVC)
 
 inline void null_test()
 {

Modified: trunk/libs/asio/test/wait_traits.cpp
==============================================================================
--- trunk/libs/asio/test/wait_traits.cpp (original)
+++ trunk/libs/asio/test/wait_traits.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("wait_traits");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "wait_traits",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/waitable_timer_service.cpp
==============================================================================
--- trunk/libs/asio/test/waitable_timer_service.cpp (original)
+++ trunk/libs/asio/test/waitable_timer_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("waitable_timer_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "waitable_timer_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/windows/basic_handle.cpp
==============================================================================
--- trunk/libs/asio/test/windows/basic_handle.cpp (original)
+++ trunk/libs/asio/test/windows/basic_handle.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,9 +19,8 @@
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/basic_handle");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/basic_handle",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/windows/basic_object_handle.cpp
==============================================================================
--- trunk/libs/asio/test/windows/basic_object_handle.cpp (original)
+++ trunk/libs/asio/test/windows/basic_object_handle.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,9 +19,8 @@
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/basic_object_handle");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/basic_object_handle",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/windows/basic_random_access_handle.cpp
==============================================================================
--- trunk/libs/asio/test/windows/basic_random_access_handle.cpp (original)
+++ trunk/libs/asio/test/windows/basic_random_access_handle.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,9 +19,8 @@
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/basic_random_access_handle");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/basic_random_access_handle",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/windows/basic_stream_handle.cpp
==============================================================================
--- trunk/libs/asio/test/windows/basic_stream_handle.cpp (original)
+++ trunk/libs/asio/test/windows/basic_stream_handle.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,9 +19,8 @@
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/basic_stream_handle");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/basic_stream_handle",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/windows/object_handle.cpp
==============================================================================
--- trunk/libs/asio/test/windows/object_handle.cpp (original)
+++ trunk/libs/asio/test/windows/object_handle.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -113,9 +113,9 @@
 } // namespace windows_object_handle_compile
 
 //------------------------------------------------------------------------------
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/object_handle");
- test->add(BOOST_TEST_CASE(&windows_object_handle_compile::test));
- return test;
-}
+
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/object_handle",
+ BOOST_ASIO_TEST_CASE(windows_object_handle_compile::test)
+)

Modified: trunk/libs/asio/test/windows/object_handle_service.cpp
==============================================================================
--- trunk/libs/asio/test/windows/object_handle_service.cpp (original)
+++ trunk/libs/asio/test/windows/object_handle_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,9 +19,8 @@
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/object_handle_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/object_handle_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/windows/overlapped_ptr.cpp
==============================================================================
--- trunk/libs/asio/test/windows/overlapped_ptr.cpp (original)
+++ trunk/libs/asio/test/windows/overlapped_ptr.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -87,9 +87,9 @@
 } // namespace windows_overlapped_ptr_compile
 
 //------------------------------------------------------------------------------
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/overlapped_ptr");
- test->add(BOOST_TEST_CASE(&windows_overlapped_ptr_compile::test));
- return test;
-}
+
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/overlapped_ptr",
+ BOOST_ASIO_TEST_CASE(windows_overlapped_ptr_compile::test)
+)

Modified: trunk/libs/asio/test/windows/random_access_handle.cpp
==============================================================================
--- trunk/libs/asio/test/windows/random_access_handle.cpp (original)
+++ trunk/libs/asio/test/windows/random_access_handle.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -141,9 +141,9 @@
 } // namespace windows_random_access_handle_compile
 
 //------------------------------------------------------------------------------
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/random_access_handle");
- test->add(BOOST_TEST_CASE(&windows_random_access_handle_compile::test));
- return test;
-}
+
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/random_access_handle",
+ BOOST_ASIO_TEST_CASE(windows_random_access_handle_compile::test)
+)

Modified: trunk/libs/asio/test/windows/random_access_handle_service.cpp
==============================================================================
--- trunk/libs/asio/test/windows/random_access_handle_service.cpp (original)
+++ trunk/libs/asio/test/windows/random_access_handle_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,9 +19,8 @@
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/random_access_handle_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/random_access_handle_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/windows/stream_handle.cpp
==============================================================================
--- trunk/libs/asio/test/windows/stream_handle.cpp (original)
+++ trunk/libs/asio/test/windows/stream_handle.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -134,9 +134,9 @@
 } // namespace windows_stream_handle_compile
 
 //------------------------------------------------------------------------------
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/stream_handle");
- test->add(BOOST_TEST_CASE(&windows_stream_handle_compile::test));
- return test;
-}
+
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/stream_handle",
+ BOOST_ASIO_TEST_CASE(windows_stream_handle_compile::test)
+)

Modified: trunk/libs/asio/test/windows/stream_handle_service.cpp
==============================================================================
--- trunk/libs/asio/test/windows/stream_handle_service.cpp (original)
+++ trunk/libs/asio/test/windows/stream_handle_service.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -19,9 +19,8 @@
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/stream_handle_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/stream_handle_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: trunk/libs/asio/test/write.cpp
==============================================================================
--- trunk/libs/asio/test/write.cpp (original)
+++ trunk/libs/asio/test/write.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,24 +16,30 @@
 // Test that header file is self-contained.
 #include <boost/asio/write.hpp>
 
-#if defined(BOOST_ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
-#include <boost/array.hpp>
-#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
 #include <cstring>
 #include <vector>
 #include "archetypes/async_result.hpp"
 #include <boost/asio/io_service.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/asio/streambuf.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+#include <boost/array.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+# include <array>
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
+
 using namespace std; // For memcmp, memcpy and memset.
 
 class test_stream
- : private boost::noncopyable
 {
 public:
   typedef boost::asio::io_service io_service_type;
@@ -54,7 +60,7 @@
 
   void reset(size_t length = max_length)
   {
- BOOST_CHECK(length <= max_length);
+ BOOST_ASIO_CHECK(length <= max_length);
 
     memset(data_, 0, max_length);
     length_ = length;
@@ -136,7 +142,7 @@
   std::vector<boost::asio::const_buffer> buffers;
 
   size_t bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void test_2_arg_const_buffers_1_write()
@@ -148,20 +154,20 @@
 
   s.reset();
   size_t bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_2_arg_mutable_buffers_1_write()
@@ -173,20 +179,20 @@
 
   s.reset();
   size_t bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 }
 
 void test_2_arg_vector_buffers_write()
@@ -199,20 +205,20 @@
 
   s.reset();
   size_t bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_3_arg_nothrow_zero_buffers_write()
@@ -223,8 +229,8 @@
 
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == 0);
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_3_arg_nothrow_const_buffers_1_write()
@@ -237,23 +243,23 @@
   s.reset();
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_3_arg_nothrow_mutable_buffers_1_write()
@@ -266,23 +272,23 @@
   s.reset();
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_3_arg_nothrow_vector_buffers_write()
@@ -296,23 +302,23 @@
   s.reset();
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 bool old_style_transfer_all(const boost::system::error_code& ec,
@@ -337,176 +343,176 @@
   s.reset();
   size_t bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_3_arg_mutable_buffers_1_write()
@@ -519,176 +525,176 @@
   s.reset();
   size_t bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 }
 
 void test_3_arg_vector_buffers_write()
@@ -702,176 +708,176 @@
   s.reset();
   size_t bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_4_arg_const_buffers_1_write()
@@ -885,230 +891,230 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_mutable_buffers_1_write()
@@ -1122,230 +1128,230 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_vector_buffers_write()
@@ -1360,242 +1366,250 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void async_write_handler(const boost::system::error_code& e,
     size_t bytes_transferred, size_t expected_bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!e);
- BOOST_CHECK(bytes_transferred == expected_bytes_transferred);
+ BOOST_ASIO_CHECK(!e);
+ BOOST_ASIO_CHECK(bytes_transferred == expected_bytes_transferred);
 }
 
 void test_3_arg_const_buffers_1_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::const_buffers_1 buffers
@@ -1604,51 +1618,53 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write(s, buffers, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_3_arg_mutable_buffers_1_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::mutable_buffers_1 buffers
@@ -1657,51 +1673,54 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   int i = boost::asio::async_write(s, buffers, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 }
 
 void test_3_arg_boost_array_buffers_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::array<boost::asio::const_buffer, 2> buffers = { {
@@ -1711,51 +1730,54 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write(s, buffers, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_3_arg_std_array_buffers_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
@@ -1766,52 +1788,54 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write(s, buffers, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_3_arg_vector_buffers_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   std::vector<boost::asio::const_buffer> buffers;
@@ -1821,51 +1845,53 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write(s, buffers, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_3_arg_streambuf_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::streambuf sb;
@@ -1877,14 +1903,12 @@
   sb.sputn(write_data, sizeof(write_data));
   bool called = false;
   boost::asio::async_write(s, sb,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -1892,14 +1916,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, sb,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -1907,27 +1929,33 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, sb,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   int i = boost::asio::async_write(s, sb, archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_4_arg_const_buffers_1_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::const_buffers_1 buffers
@@ -1936,356 +1964,310 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write(s, buffers, short_transfer,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_4_arg_mutable_buffers_1_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::mutable_buffers_1 buffers
@@ -2294,356 +2276,311 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   int i = boost::asio::async_write(s, buffers, short_transfer,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_4_arg_boost_array_buffers_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::array<boost::asio::const_buffer, 2> buffers = { {
@@ -2653,356 +2590,311 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write(s, buffers, short_transfer,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_4_arg_std_array_buffers_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
@@ -3013,357 +2905,311 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write(s, buffers, short_transfer,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_4_arg_vector_buffers_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   std::vector<boost::asio::const_buffer> buffers;
@@ -3373,356 +3219,310 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write(s, buffers, short_transfer,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_4_arg_streambuf_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::streambuf sb;
@@ -3734,14 +3534,12 @@
   sb.sputn(write_data, sizeof(write_data));
   bool called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -3749,14 +3547,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -3764,28 +3560,24 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -3793,14 +3585,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   sb.consume(sb.size());
@@ -3808,28 +3598,24 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -3837,14 +3623,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
@@ -3852,28 +3636,24 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -3881,14 +3661,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   sb.consume(sb.size());
@@ -3896,28 +3674,24 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   sb.consume(sb.size());
@@ -3925,14 +3699,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   sb.consume(sb.size());
@@ -3940,28 +3712,24 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
@@ -3969,14 +3737,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
@@ -3984,28 +3750,24 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   sb.consume(sb.size());
@@ -4013,14 +3775,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   sb.consume(sb.size());
@@ -4028,28 +3788,24 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, sb, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   called = false;
   boost::asio::async_write(s, sb, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -4057,14 +3813,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, sb, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -4072,28 +3826,24 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, sb, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   called = false;
   boost::asio::async_write(s, sb, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -4101,14 +3851,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, sb, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -4116,54 +3864,51 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, sb, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   int i = boost::asio::async_write(s, sb, short_transfer,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("write");
- test->add(BOOST_TEST_CASE(&test_2_arg_zero_buffers_write));
- test->add(BOOST_TEST_CASE(&test_2_arg_const_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_2_arg_mutable_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_2_arg_vector_buffers_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_zero_buffers_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_const_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_mutable_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_vector_buffers_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_const_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_mutable_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_vector_buffers_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_const_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_const_buffers_1_async_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_mutable_buffers_1_async_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_boost_array_buffers_async_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_std_array_buffers_async_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_vector_buffers_async_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_streambuf_async_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_const_buffers_1_async_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_async_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_boost_array_buffers_async_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_std_array_buffers_async_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_async_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_streambuf_async_write));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "write",
+ BOOST_ASIO_TEST_CASE(test_2_arg_zero_buffers_write)
+ BOOST_ASIO_TEST_CASE(test_2_arg_const_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_2_arg_mutable_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_2_arg_vector_buffers_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_zero_buffers_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_const_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_mutable_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_vector_buffers_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_const_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_mutable_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_vector_buffers_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_const_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_const_buffers_1_async_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_mutable_buffers_1_async_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_boost_array_buffers_async_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_std_array_buffers_async_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_vector_buffers_async_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_streambuf_async_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_const_buffers_1_async_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_async_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_boost_array_buffers_async_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_std_array_buffers_async_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_async_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_streambuf_async_write)
+)

Modified: trunk/libs/asio/test/write_at.cpp
==============================================================================
--- trunk/libs/asio/test/write_at.cpp (original)
+++ trunk/libs/asio/test/write_at.cpp 2013-05-17 06:06:50 EDT (Fri, 17 May 2013)
@@ -16,23 +16,29 @@
 // Test that header file is self-contained.
 #include <boost/asio/write_at.hpp>
 
-#if defined(BOOST_ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
-#include <boost/array.hpp>
-#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
 #include <cstring>
 #include "archetypes/async_result.hpp"
 #include <boost/asio/io_service.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/asio/streambuf.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+#include <boost/array.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+# include <array>
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
+
 using namespace std; // For memcmp, memcpy and memset.
 
 class test_random_access_device
- : private boost::noncopyable
 {
 public:
   typedef boost::asio::io_service io_service_type;
@@ -62,7 +68,7 @@
   }
 
   template <typename Const_Buffers>
- bool check_buffers(boost::uint64_t offset,
+ bool check_buffers(boost::asio::uint64_t offset,
       const Const_Buffers& buffers, size_t length)
   {
     if (offset + length > max_length)
@@ -86,7 +92,8 @@
   }
 
   template <typename Const_Buffers>
- size_t write_some_at(boost::uint64_t offset, const Const_Buffers& buffers)
+ size_t write_some_at(boost::asio::uint64_t offset,
+ const Const_Buffers& buffers)
   {
     return boost::asio::buffer_copy(
         boost::asio::buffer(data_, length_) + offset,
@@ -94,7 +101,7 @@
   }
 
   template <typename Const_Buffers>
- size_t write_some_at(boost::uint64_t offset,
+ size_t write_some_at(boost::asio::uint64_t offset,
       const Const_Buffers& buffers, boost::system::error_code& ec)
   {
     ec = boost::system::error_code();
@@ -102,7 +109,7 @@
   }
 
   template <typename Const_Buffers, typename Handler>
- void async_write_some_at(boost::uint64_t offset,
+ void async_write_some_at(boost::asio::uint64_t offset,
       const Const_Buffers& buffers, Handler handler)
   {
     size_t bytes_transferred = write_some_at(offset, buffers);
@@ -132,37 +139,37 @@
 
   s.reset();
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 }
 
 void test_3_arg_mutable_buffers_1_write_at()
@@ -174,37 +181,37 @@
 
   s.reset();
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 }
 
 void test_3_arg_vector_buffers_write_at()
@@ -217,37 +224,37 @@
 
   s.reset();
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 }
 
 void test_4_arg_nothrow_const_buffers_1_write_at()
@@ -260,43 +267,43 @@
   s.reset();
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_nothrow_mutable_buffers_1_write_at()
@@ -309,43 +316,43 @@
   s.reset();
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_nothrow_vector_buffers_write_at()
@@ -359,43 +366,43 @@
   s.reset();
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 bool old_style_transfer_all(const boost::system::error_code& ec,
@@ -420,356 +427,356 @@
   s.reset();
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 }
 
 void test_4_arg_mutable_buffers_1_write_at()
@@ -782,356 +789,356 @@
   s.reset();
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 }
 
 void test_4_arg_vector_buffers_write_at()
@@ -1145,356 +1152,356 @@
   s.reset();
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 }
 
 void test_5_arg_const_buffers_1_write_at()
@@ -1508,464 +1515,464 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_5_arg_mutable_buffers_1_write_at()
@@ -1979,464 +1986,464 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_5_arg_vector_buffers_write_at()
@@ -2451,476 +2458,484 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void async_write_handler(const boost::system::error_code& e,
     size_t bytes_transferred, size_t expected_bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!e);
- BOOST_CHECK(bytes_transferred == expected_bytes_transferred);
+ BOOST_ASIO_CHECK(!e);
+ BOOST_ASIO_CHECK(bytes_transferred == expected_bytes_transferred);
 }
 
 void test_4_arg_const_buffers_1_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::asio::const_buffers_1 buffers
@@ -2929,103 +2944,97 @@
   s.reset();
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write_at(s, 0, buffers,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 }
 
 void test_4_arg_mutable_buffers_1_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::asio::mutable_buffers_1 buffers
@@ -3034,103 +3043,98 @@
   s.reset();
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   int i = boost::asio::async_write_at(s, 0, buffers,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 }
 
 void test_4_arg_boost_array_buffers_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::array<boost::asio::const_buffer, 2> buffers = { {
@@ -3140,103 +3144,98 @@
   s.reset();
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write_at(s, 0, buffers,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_4_arg_std_array_buffers_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
@@ -3247,104 +3246,98 @@
   s.reset();
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write_at(s, 0, buffers,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_4_arg_vector_buffers_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   std::vector<boost::asio::const_buffer> buffers;
@@ -3354,103 +3347,97 @@
   s.reset();
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write_at(s, 0, buffers,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 }
 
 void test_4_arg_streambuf_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::asio::streambuf sb;
@@ -3462,28 +3449,24 @@
   sb.sputn(write_data, sizeof(write_data));
   bool called = false;
   boost::asio::async_write_at(s, 0, sb,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -3491,14 +3474,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, sb,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -3506,14 +3487,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -3521,14 +3500,12 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, sb,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -3536,14 +3513,12 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -3551,28 +3526,34 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, sb,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   int i = boost::asio::async_write_at(s, 0, sb,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 }
 
 void test_5_arg_const_buffers_1_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::asio::const_buffers_1 buffers
@@ -3582,739 +3563,639 @@
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write_at(s, 0, buffers, short_transfer,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 }
 
 void test_5_arg_mutable_buffers_1_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::asio::mutable_buffers_1 buffers
@@ -4324,739 +4205,640 @@
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   int i = boost::asio::async_write_at(s, 0, buffers, short_transfer,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 }
 
 void test_5_arg_boost_array_buffers_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::array<boost::asio::const_buffer, 2> buffers = { {
@@ -5067,739 +4849,640 @@
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write_at(s, 0, buffers, short_transfer,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_5_arg_std_array_buffers_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
@@ -5811,740 +5494,640 @@
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write_at(s, 0, buffers, short_transfer,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_5_arg_vector_buffers_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   std::vector<boost::asio::const_buffer> buffers;
@@ -6555,739 +6138,639 @@
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   int i = boost::asio::async_write_at(s, 0, buffers, short_transfer,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 }
 
 void test_5_arg_streambuf_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::asio::streambuf sb;
@@ -7300,14 +6783,12 @@
   bool called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -7315,14 +6796,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -7331,14 +6810,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -7347,14 +6824,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -7363,14 +6838,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -7379,14 +6852,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -7394,14 +6865,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -7409,14 +6878,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -7425,14 +6892,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   sb.consume(sb.size());
@@ -7441,14 +6906,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   sb.consume(sb.size());
@@ -7457,14 +6920,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
@@ -7473,14 +6934,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
@@ -7488,14 +6947,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -7503,14 +6960,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -7519,14 +6974,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
@@ -7535,14 +6988,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
@@ -7551,14 +7002,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
@@ -7567,14 +7016,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
@@ -7582,14 +7029,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -7597,14 +7042,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -7613,14 +7056,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   sb.consume(sb.size());
@@ -7629,14 +7070,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   sb.consume(sb.size());
@@ -7645,14 +7084,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   sb.consume(sb.size());
@@ -7661,14 +7098,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   sb.consume(sb.size());
@@ -7676,14 +7111,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   sb.consume(sb.size());
@@ -7691,14 +7124,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   sb.consume(sb.size());
@@ -7707,14 +7138,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   sb.consume(sb.size());
@@ -7723,14 +7152,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   sb.consume(sb.size());
@@ -7739,14 +7166,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   sb.consume(sb.size());
@@ -7755,14 +7180,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   sb.consume(sb.size());
@@ -7770,14 +7193,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
@@ -7785,14 +7206,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
@@ -7801,14 +7220,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
@@ -7817,14 +7234,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
@@ -7833,14 +7248,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
@@ -7849,14 +7262,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   sb.consume(sb.size());
@@ -7864,14 +7275,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   sb.consume(sb.size());
@@ -7879,14 +7288,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   sb.consume(sb.size());
@@ -7895,14 +7302,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   sb.consume(sb.size());
@@ -7911,14 +7316,12 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   sb.consume(sb.size());
@@ -7927,14 +7330,12 @@
   called = false;
   boost::asio::async_write_at(s, 0, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   sb.consume(sb.size());
@@ -7943,42 +7344,36 @@
   called = false;
   boost::asio::async_write_at(s, 1234, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   called = false;
   boost::asio::async_write_at(s, 0, sb, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   called = false;
   boost::asio::async_write_at(s, 1234, sb, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -7986,14 +7381,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, sb, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -8001,14 +7394,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, sb, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -8016,14 +7407,12 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, sb, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -8031,42 +7420,36 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, sb, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   called = false;
   boost::asio::async_write_at(s, 0, sb, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   called = false;
   boost::asio::async_write_at(s, 1234, sb, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -8074,14 +7457,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, sb, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -8089,14 +7470,12 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, sb, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -8104,14 +7483,12 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, sb, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
@@ -8119,52 +7496,49 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, sb, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   sb.consume(sb.size());
   sb.sputn(write_data, sizeof(write_data));
   int i = boost::asio::async_write_at(s, 0, sb, short_transfer,
       archetypes::lazy_handler());
- BOOST_CHECK(i == 42);
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("write_at");
- test->add(BOOST_TEST_CASE(&test_3_arg_const_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_3_arg_mutable_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_3_arg_vector_buffers_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_nothrow_const_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_nothrow_mutable_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_nothrow_vector_buffers_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_const_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_const_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_mutable_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_vector_buffers_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_const_buffers_1_async_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_async_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_boost_array_buffers_async_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_std_array_buffers_async_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_async_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_streambuf_async_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_const_buffers_1_async_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_mutable_buffers_1_async_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_boost_array_buffers_async_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_std_array_buffers_async_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_vector_buffers_async_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_streambuf_async_write_at));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "write_at",
+ BOOST_ASIO_TEST_CASE(test_3_arg_const_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_3_arg_mutable_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_3_arg_vector_buffers_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_nothrow_const_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_nothrow_mutable_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_nothrow_vector_buffers_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_const_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_const_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_mutable_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_vector_buffers_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_const_buffers_1_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_boost_array_buffers_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_std_array_buffers_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_streambuf_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_const_buffers_1_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_mutable_buffers_1_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_boost_array_buffers_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_std_array_buffers_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_vector_buffers_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_streambuf_async_write_at)
+)


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