Index: boost/asio/impl/write.ipp =================================================================== --- boost/asio/impl/write.ipp (revision 57990) +++ boost/asio/impl/write.ipp (working copy) @@ -70,6 +70,7 @@ return bytes_transferred; } +#ifndef BOOST_NO_IOSTREAM template std::size_t write(SyncWriteStream& s, @@ -102,6 +103,7 @@ boost::asio::detail::throw_error(ec); return bytes_transferred; } +#endif // BOOST_NO_IOSTREAM namespace detail { @@ -213,6 +215,7 @@ async_write(s, buffers, transfer_all(), handler); } +#ifndef BOOST_NO_IOSTREAM namespace detail { template std::size_t read(SyncReadStream& s, @@ -121,6 +122,7 @@ boost::asio::detail::throw_error(ec); return bytes_transferred; } +#endif // BOOST_NO_IOSTREAM namespace detail { @@ -232,6 +234,7 @@ async_read(s, buffers, transfer_all(), handler); } +#ifndef BOOST_NO_IOSTREAM namespace detail { template #include -#include +#include #include #include Index: boost/asio/detail/reactive_socket_service.hpp =================================================================== --- boost/asio/detail/reactive_socket_service.hpp (revision 57990) +++ boost/asio/detail/reactive_socket_service.hpp (working copy) @@ -275,6 +275,12 @@ return false; } +#ifndef SIOCATMARK + int value = sockatmark(impl.socket_); + if (value == -1) ec = boost::system::error_code(errno + , boost::system::get_system_category()); + return ec ? false : value != 0; +#else boost::asio::detail::ioctl_arg_type value = 0; socket_ops::ioctl(impl.socket_, SIOCATMARK, &value, ec); #if defined(ENOTTY) @@ -282,6 +288,7 @@ ec = boost::asio::error::not_socket; #endif // defined(ENOTTY) return ec ? false : value != 0; +#endif } // Determine the number of bytes available for reading. Index: boost/asio/detail/handler_alloc_helpers.hpp =================================================================== --- boost/asio/detail/handler_alloc_helpers.hpp (revision 57990) +++ boost/asio/detail/handler_alloc_helpers.hpp (working copy) @@ -32,7 +32,8 @@ template inline void* allocate(std::size_t s, Handler* h) { -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \ + || __GNUC__ < 3 return ::operator new(s); #else using namespace boost::asio; @@ -43,7 +44,8 @@ template inline void deallocate(void* p, std::size_t s, Handler* h) { -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \ + || __GNUC__ < 3 ::operator delete(p); #else using namespace boost::asio; Index: boost/asio/detail/consuming_buffers.hpp =================================================================== --- boost/asio/detail/consuming_buffers.hpp (revision 57990) +++ boost/asio/detail/consuming_buffers.hpp (working copy) @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include Index: boost/asio/detail/handler_invoke_helpers.hpp =================================================================== --- boost/asio/detail/handler_invoke_helpers.hpp (revision 57990) +++ boost/asio/detail/handler_invoke_helpers.hpp (working copy) @@ -31,7 +31,8 @@ template inline void invoke(const Function& function, Context* context) { -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \ + || __GNUC__ < 3 Function tmp(function); tmp(); #else Index: boost/asio/detail/socket_types.hpp =================================================================== --- boost/asio/detail/socket_types.hpp (revision 57990) +++ boost/asio/detail/socket_types.hpp (working copy) @@ -163,7 +166,11 @@ const int invalid_socket = -1; const int socket_error_retval = -1; const int max_addr_v4_str_len = INET_ADDRSTRLEN; +#ifndef INET6_ADDRSTRLEN +const int max_addr_v6_str_len = 256; +#else const int max_addr_v6_str_len = INET6_ADDRSTRLEN + 1 + IF_NAMESIZE; +#endif typedef sockaddr socket_addr_type; typedef in_addr in4_addr_type; # if defined(__hpux) Index: boost/asio/detail/timer_queue.hpp =================================================================== --- boost/asio/detail/timer_queue.hpp (revision 57990) +++ boost/asio/detail/timer_queue.hpp (working copy) @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include Index: boost/asio/basic_streambuf.hpp =================================================================== --- boost/asio/basic_streambuf.hpp (revision 57990) +++ boost/asio/basic_streambuf.hpp (working copy) @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include Index: boost/asio/write.hpp =================================================================== --- boost/asio/write.hpp (revision 57990) +++ boost/asio/write.hpp (working copy) @@ -22,7 +22,9 @@ #include #include +#ifndef BOOST_NO_IOSTREAM #include +#endif #include namespace boost { @@ -195,8 +197,10 @@ * s, b, * boost::asio::transfer_all()); @endcode */ +#ifndef BOOST_NO_IOSTREAM template std::size_t write(SyncWriteStream& s, basic_streambuf& b); +#endif /// Write a certain amount of data to a stream before returning. /** @@ -233,10 +237,12 @@ * * @throws boost::system::system_error Thrown on failure. */ +#ifndef BOOST_NO_IOSTREAM template std::size_t write(SyncWriteStream& s, basic_streambuf& b, CompletionCondition completion_condition); +#endif /// Write a certain amount of data to a stream before returning. /** @@ -274,10 +280,12 @@ * @returns The number of bytes written. If an error occurs, returns the total * number of bytes successfully transferred prior to the error. */ +#ifndef BOOST_NO_IOSTREAM template std::size_t write(SyncWriteStream& s, basic_streambuf& b, CompletionCondition completion_condition, boost::system::error_code& ec); +#endif /*@}*/ /** @@ -449,9 +457,11 @@ * the handler will be performed in a manner equivalent to using * boost::asio::io_service::post(). */ +#ifndef BOOST_NO_IOSTREAM template void async_write(AsyncWriteStream& s, basic_streambuf& b, WriteHandler handler); +#endif /// Start an asynchronous operation to write a certain amount of data to a /// stream. @@ -505,10 +515,12 @@ * the handler will be performed in a manner equivalent to using * boost::asio::io_service::post(). */ +#ifndef BOOST_NO_IOSTREAM template void async_write(AsyncWriteStream& s, basic_streambuf& b, CompletionCondition completion_condition, WriteHandler handler); +#endif /*@}*/ Index: boost/asio/read.hpp =================================================================== --- boost/asio/read.hpp (revision 57990) +++ boost/asio/read.hpp (working copy) @@ -22,7 +22,9 @@ #include #include +#ifndef BOOST_NO_IOSTREAM #include +#endif #include namespace boost { @@ -194,8 +196,10 @@ * s, b, * boost::asio::transfer_all()); @endcode */ +#ifndef BOOST_NO_IOSTREAM template std::size_t read(SyncReadStream& s, basic_streambuf& b); +#endif /// Attempt to read a certain amount of data from a stream before returning. /** @@ -230,10 +234,12 @@ * * @throws boost::system::system_error Thrown on failure. */ +#ifndef BOOST_NO_IOSTREAM template std::size_t read(SyncReadStream& s, basic_streambuf& b, CompletionCondition completion_condition); +#endif /// Attempt to read a certain amount of data from a stream before returning. /** @@ -269,10 +275,12 @@ * @returns The number of bytes read. If an error occurs, returns the total * number of bytes successfully transferred prior to the error. */ +#ifndef BOOST_NO_IOSTREAM template std::size_t read(SyncReadStream& s, basic_streambuf& b, CompletionCondition completion_condition, boost::system::error_code& ec); +#endif /*@}*/ /** @@ -456,9 +464,11 @@ * boost::asio::transfer_all(), * handler); @endcode */ +#ifndef BOOST_NO_IOSTREAM template void async_read(AsyncReadStream& s, basic_streambuf& b, ReadHandler handler); +#endif /// Start an asynchronous operation to read a certain amount of data from a /// stream. @@ -511,10 +521,12 @@ * the handler will be performed in a manner equivalent to using * boost::asio::io_service::post(). */ +#ifndef BOOST_NO_IOSTREAM template void async_read(AsyncReadStream& s, basic_streambuf& b, CompletionCondition completion_condition, ReadHandler handler); +#endif /*@}*/ Index: boost/asio/ip/address_v4.hpp =================================================================== --- boost/asio/ip/address_v4.hpp (revision 57990) +++ boost/asio/ip/address_v4.hpp (working copy) @@ -281,6 +281,7 @@ * * @relates boost::asio::ip::address_v4 */ +#ifndef BOOST_NO_IOSTREAM template std::basic_ostream& operator<<( std::basic_ostream& os, const address_v4& addr) @@ -299,6 +300,7 @@ os << os.widen(*i); return os; } +#endif } // namespace ip } // namespace asio Index: boost/asio/ip/address_v6.hpp =================================================================== --- boost/asio/ip/address_v6.hpp (revision 57990) +++ boost/asio/ip/address_v6.hpp (working copy) @@ -395,6 +395,7 @@ * * @relates boost::asio::ip::address_v6 */ +#ifndef BOOST_NO_IOSTREAM template std::basic_ostream& operator<<( std::basic_ostream& os, const address_v6& addr) @@ -413,6 +414,7 @@ os << os.widen(*i); return os; } +#endif } // namespace ip } // namespace asio Index: boost/asio/ip/basic_endpoint.hpp =================================================================== --- boost/asio/ip/basic_endpoint.hpp (revision 57990) +++ boost/asio/ip/basic_endpoint.hpp (working copy) @@ -21,10 +21,12 @@ #include #include #include +#ifndef BOOST_NO_IOSTREAM #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) # include #endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) #include +#endif // BOOST_NO_IOSTREAM #include #include @@ -309,6 +311,7 @@ * * @relates boost::asio::ip::basic_endpoint */ +#ifndef BOOST_NO_IOSTREAM #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) template std::ostream& operator<<(std::ostream& os, @@ -367,6 +370,7 @@ return os; } #endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#endif // BOOST_NO_IOSTREAM } // namespace ip } // namespace asio Index: boost/asio/ip/address.hpp =================================================================== --- boost/asio/ip/address.hpp (revision 57990) +++ boost/asio/ip/address.hpp (working copy) @@ -262,6 +262,7 @@ * * @relates boost::asio::ip::address */ +#ifndef BOOST_NO_IOSTREAM template std::basic_ostream& operator<<( std::basic_ostream& os, const address& addr) @@ -269,6 +270,7 @@ os << addr.to_string(); return os; } +#endif } // namespace ip } // namespace asio Index: boost/asio/ip/tcp.hpp =================================================================== --- boost/asio/ip/tcp.hpp (revision 57990) +++ boost/asio/ip/tcp.hpp (working copy) @@ -17,8 +17,11 @@ #include +#include #include +#ifndef BOOST_NO_IOSTREAM #include +#endif #include #include #include @@ -94,7 +97,9 @@ typedef basic_resolver resolver; /// The TCP iostream type. +#ifndef BOOST_NO_IOSTREAM typedef basic_socket_iostream iostream; +#endif /// Socket option for disabling the Nagle algorithm. /** Index: boost/asio/time_traits.hpp =================================================================== --- boost/asio/time_traits.hpp (revision 57990) +++ boost/asio/time_traits.hpp (working copy) @@ -43,7 +43,11 @@ /// Get the current time. static time_type now() { +#ifdef BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK return boost::posix_time::microsec_clock::universal_time(); +#else + return boost::posix_time::second_clock::universal_time(); +#endif } /// Add a duration to a time.