Add ASIO_NO_EXTENSIONS to disable the non-TS parts of the API.

This commit is contained in:
Christopher Kohlhoff 2016-08-24 11:17:15 +10:00
parent 0f6478c9c9
commit c1f2a3b735
5 changed files with 23 additions and 6 deletions

View File

@ -77,8 +77,10 @@ public:
/// The endpoint type.
typedef typename Protocol::endpoint endpoint_type;
#if !defined(ASIO_NO_EXTENSIONS)
/// A basic_socket is always the lowest layer.
typedef basic_socket<Protocol ASIO_SVC_TARG> lowest_layer_type;
#endif // !defined(ASIO_NO_EXTENSIONS)
/// Construct a basic_socket without opening it.
/**
@ -278,6 +280,7 @@ public:
}
#endif // defined(ASIO_ENABLE_OLD_SERVICES)
#if !defined(ASIO_NO_EXTENSIONS)
/// Get a reference to the lowest layer.
/**
* This function returns a reference to the lowest layer in a stack of
@ -305,6 +308,7 @@ public:
{
return *this;
}
#endif // !defined(ASIO_NO_EXTENSIONS)
/// Open the socket using the specified protocol.
/**

View File

@ -1067,6 +1067,7 @@ public:
#endif // defined(ASIO_ENABLE_OLD_SERVICES)
}
#if !defined(ASIO_NO_EXTENSIONS)
/// Accept a new connection.
/**
* This function is used to accept a new connection from a peer into the
@ -1350,6 +1351,7 @@ public:
return init.result.get();
#endif // defined(ASIO_ENABLE_OLD_SERVICES)
}
#endif // !defined(ASIO_NO_EXTENSIONS)
#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Accept a new connection.

View File

@ -161,7 +161,9 @@ public:
class service;
#if !defined(ASIO_NO_EXTENSIONS)
class strand;
#endif // !defined(ASIO_NO_EXTENSIONS)
/// The type used to count the number of handlers executed by the context.
typedef std::size_t count_type;
@ -819,8 +821,10 @@ asio::detail::service_id<Type> service_base<Type>::id;
// If both io_context.hpp and strand.hpp have been included, automatically
// include the header file needed for the io_context::strand class.
#if defined(ASIO_STRAND_HPP)
# include "asio/io_context_strand.hpp"
#endif // defined(ASIO_STRAND_HPP)
#if !defined(ASIO_NO_EXTENSIONS)
# if defined(ASIO_STRAND_HPP)
# include "asio/io_context_strand.hpp"
# endif // defined(ASIO_STRAND_HPP)
#endif // !defined(ASIO_NO_EXTENSIONS)
#endif // ASIO_IO_CONTEXT_HPP

View File

@ -16,6 +16,9 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#if !defined(ASIO_NO_EXTENSIONS)
#include "asio/async_result.hpp"
#include "asio/detail/handler_type_requirements.hpp"
#include "asio/detail/strand_service.hpp"
@ -374,4 +377,6 @@ private:
#include "asio/detail/pop_options.hpp"
#endif // !defined(ASIO_NO_EXTENSIONS)
#endif // ASIO_IO_CONTEXT_STRAND_HPP

View File

@ -277,8 +277,10 @@ private:
// If both io_context.hpp and strand.hpp have been included, automatically
// include the header file needed for the io_context::strand class.
#if defined(ASIO_IO_CONTEXT_HPP)
# include "asio/io_context_strand.hpp"
#endif // defined(ASIO_IO_CONTEXT_HPP)
#if !defined(ASIO_NO_EXTENSIONS)
# if defined(ASIO_IO_CONTEXT_HPP)
# include "asio/io_context_strand.hpp"
# endif // defined(ASIO_IO_CONTEXT_HPP)
#endif // !defined(ASIO_NO_EXTENSIONS)
#endif // ASIO_STRAND_HPP