summaryrefslogtreecommitdiff
path: root/boost/asio/detail
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:24:45 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:24:45 +0900
commit5ce1cfc2525b06c0a9e38531813781de0281c96d (patch)
tree19cc66c6cf6396db288813b2558cc350f1deede2 /boost/asio/detail
parent3c1df2168531ad5580076ae08d529054689aeedd (diff)
downloadboost-5ce1cfc2525b06c0a9e38531813781de0281c96d.tar.gz
boost-5ce1cfc2525b06c0a9e38531813781de0281c96d.tar.bz2
boost-5ce1cfc2525b06c0a9e38531813781de0281c96d.zip
Imported Upstream version 1.71.0upstream/1.71.0
Diffstat (limited to 'boost/asio/detail')
-rw-r--r--boost/asio/detail/config.hpp14
-rw-r--r--boost/asio/detail/impl/win_iocp_handle_service.ipp3
-rw-r--r--boost/asio/detail/impl/win_iocp_serial_port_service.ipp15
-rw-r--r--boost/asio/detail/impl/win_iocp_socket_service_base.ipp3
-rw-r--r--boost/asio/detail/io_object_executor.hpp7
-rw-r--r--boost/asio/detail/is_buffer_sequence.hpp30
-rw-r--r--boost/asio/detail/winrt_ssocket_service.hpp8
-rw-r--r--boost/asio/detail/winrt_ssocket_service_base.hpp8
8 files changed, 59 insertions, 29 deletions
diff --git a/boost/asio/detail/config.hpp b/boost/asio/detail/config.hpp
index 8fef292b00..683a2b1fd6 100644
--- a/boost/asio/detail/config.hpp
+++ b/boost/asio/detail/config.hpp
@@ -341,7 +341,7 @@
// Compliant C++11 compilers put noexcept specifiers on error_category members.
#if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
-# if (BOOST_VERSION >= 105300)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105300)
# define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT
# elif defined(__clang__)
# if __has_feature(__cxx_noexcept__)
@@ -508,9 +508,9 @@
// Boost support for chrono.
#if !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
# if !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
-# if (BOOST_VERSION >= 104700)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 104700)
# define BOOST_ASIO_HAS_BOOST_CHRONO 1
-# endif // (BOOST_VERSION >= 104700)
+# endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 104700)
# endif // !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
#endif // !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
@@ -1232,6 +1232,8 @@
# define BOOST_ASIO_HAS_THREADS 1
# elif defined(__APPLE__)
# define BOOST_ASIO_HAS_THREADS 1
+# elif defined(__HAIKU__)
+# define BOOST_ASIO_HAS_THREADS 1
# elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0)
# define BOOST_ASIO_HAS_THREADS 1
# elif defined(_PTHREADS)
@@ -1247,6 +1249,8 @@
# define BOOST_ASIO_HAS_PTHREADS 1
# elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0)
# define BOOST_ASIO_HAS_PTHREADS 1
+# elif defined(__HAIKU__)
+# 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)
@@ -1427,11 +1431,11 @@
# endif // defined(BOOST_ASIO_MSVC)
# endif // !defined(BOOST_ASIO_DISABLE_CO_AWAIT)
# if defined(__clang__)
-# if (__cpp_coroutines >= 201703)
+# if (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
# if __has_include(<experimental/coroutine>)
# define BOOST_ASIO_HAS_CO_AWAIT 1
# endif // __has_include(<experimental/coroutine>)
-# endif // (__cpp_coroutines >= 201703)
+# endif // (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
# endif // defined(__clang__)
#endif // !defined(BOOST_ASIO_HAS_CO_AWAIT)
diff --git a/boost/asio/detail/impl/win_iocp_handle_service.ipp b/boost/asio/detail/impl/win_iocp_handle_service.ipp
index 1256c358ac..da33768b2b 100644
--- a/boost/asio/detail/impl/win_iocp_handle_service.ipp
+++ b/boost/asio/detail/impl/win_iocp_handle_service.ipp
@@ -243,7 +243,8 @@ boost::system::error_code win_iocp_handle_service::cancel(
{
// The version of Windows supports cancellation from any thread.
typedef BOOL (WINAPI* cancel_io_ex_t)(HANDLE, LPOVERLAPPED);
- cancel_io_ex_t cancel_io_ex = (cancel_io_ex_t)cancel_io_ex_ptr;
+ cancel_io_ex_t cancel_io_ex = reinterpret_cast<cancel_io_ex_t>(
+ reinterpret_cast<void*>(cancel_io_ex_ptr));
if (!cancel_io_ex(impl.handle_, 0))
{
DWORD last_error = ::GetLastError();
diff --git a/boost/asio/detail/impl/win_iocp_serial_port_service.ipp b/boost/asio/detail/impl/win_iocp_serial_port_service.ipp
index 4e30b0f678..a8133fa3fa 100644
--- a/boost/asio/detail/impl/win_iocp_serial_port_service.ipp
+++ b/boost/asio/detail/impl/win_iocp_serial_port_service.ipp
@@ -80,11 +80,22 @@ boost::system::error_code win_iocp_serial_port_service::open(
}
// Set some default serial port parameters. This implementation does not
- // support changing these, so they might as well be in a known state.
+ // support changing all of these, so they might as well be in a known state.
dcb.fBinary = TRUE; // Win32 only supports binary mode.
- dcb.fDsrSensitivity = FALSE;
dcb.fNull = FALSE; // Do not ignore NULL characters.
dcb.fAbortOnError = FALSE; // Ignore serial framing errors.
+ dcb.BaudRate = 0; // 0 baud by default
+ dcb.ByteSize = 8; // 8 bit bytes
+ dcb.fOutxCtsFlow = FALSE; // No flow control
+ dcb.fOutxDsrFlow = FALSE;
+ dcb.fDtrControl = DTR_CONTROL_DISABLE;
+ dcb.fDsrSensitivity = FALSE;
+ dcb.fOutX = FALSE;
+ dcb.fInX = FALSE;
+ dcb.fRtsControl = DTR_CONTROL_DISABLE;
+ dcb.fParity = FALSE; // No parity
+ dcb.Parity = NOPARITY;
+ dcb.StopBits = ONESTOPBIT; // One stop bit
if (!::SetCommState(handle, &dcb))
{
DWORD last_error = ::GetLastError();
diff --git a/boost/asio/detail/impl/win_iocp_socket_service_base.ipp b/boost/asio/detail/impl/win_iocp_socket_service_base.ipp
index f95c74ff58..5691cdb9e7 100644
--- a/boost/asio/detail/impl/win_iocp_socket_service_base.ipp
+++ b/boost/asio/detail/impl/win_iocp_socket_service_base.ipp
@@ -250,7 +250,8 @@ boost::system::error_code win_iocp_socket_service_base::cancel(
{
// The version of Windows supports cancellation from any thread.
typedef BOOL (WINAPI* cancel_io_ex_t)(HANDLE, LPOVERLAPPED);
- cancel_io_ex_t cancel_io_ex = (cancel_io_ex_t)cancel_io_ex_ptr;
+ cancel_io_ex_t cancel_io_ex = reinterpret_cast<cancel_io_ex_t>(
+ reinterpret_cast<void*>(cancel_io_ex_ptr));
socket_type sock = impl.socket_;
HANDLE sock_as_handle = reinterpret_cast<HANDLE>(sock);
if (!cancel_io_ex(sock_as_handle, 0))
diff --git a/boost/asio/detail/io_object_executor.hpp b/boost/asio/detail/io_object_executor.hpp
index 70b026b476..5b5258fcd6 100644
--- a/boost/asio/detail/io_object_executor.hpp
+++ b/boost/asio/detail/io_object_executor.hpp
@@ -113,6 +113,13 @@ public:
// When using a native implementation, I/O completion handlers are
// already dispatched according to the execution context's executor's
// rules. We can call the function directly.
+#if defined(BOOST_ASIO_HAS_MOVE)
+ if (is_same<F, typename decay<F>::type>::value)
+ {
+ boost_asio_handler_invoke_helpers::invoke(f, f);
+ return;
+ }
+#endif // defined(BOOST_ASIO_HAS_MOVE)
typename decay<F>::type function(BOOST_ASIO_MOVE_CAST(F)(f));
boost_asio_handler_invoke_helpers::invoke(function, function);
}
diff --git a/boost/asio/detail/is_buffer_sequence.hpp b/boost/asio/detail/is_buffer_sequence.hpp
index 89b8df762d..c52103206c 100644
--- a/boost/asio/detail/is_buffer_sequence.hpp
+++ b/boost/asio/detail/is_buffer_sequence.hpp
@@ -54,19 +54,22 @@ struct buffer_sequence_memfns_check
{
};
-template <typename>
-char (&buffer_sequence_begin_helper(...))[2];
-
#if defined(BOOST_ASIO_HAS_DECLTYPE)
+template <typename>
+char buffer_sequence_begin_helper(...);
+
template <typename T>
-char buffer_sequence_begin_helper(T* t,
+char (&buffer_sequence_begin_helper(T* t,
typename enable_if<!is_same<
decltype(boost::asio::buffer_sequence_begin(*t)),
- void>::value>::type*);
+ void>::value>::type*))[2];
#else // defined(BOOST_ASIO_HAS_DECLTYPE)
+template <typename>
+char (&buffer_sequence_begin_helper(...))[2];
+
template <typename T>
char buffer_sequence_begin_helper(T* t,
buffer_sequence_memfns_check<
@@ -75,19 +78,22 @@ char buffer_sequence_begin_helper(T* t,
#endif // defined(BOOST_ASIO_HAS_DECLTYPE)
-template <typename>
-char (&buffer_sequence_end_helper(...))[2];
-
#if defined(BOOST_ASIO_HAS_DECLTYPE)
+template <typename>
+char buffer_sequence_end_helper(...);
+
template <typename T>
-char buffer_sequence_end_helper(T* t,
+char (&buffer_sequence_end_helper(T* t,
typename enable_if<!is_same<
decltype(boost::asio::buffer_sequence_end(*t)),
- void>::value>::type*);
+ void>::value>::type*))[2];
#else // defined(BOOST_ASIO_HAS_DECLTYPE)
+template <typename>
+char (&buffer_sequence_end_helper(...))[2];
+
template <typename T>
char buffer_sequence_end_helper(T* t,
buffer_sequence_memfns_check<
@@ -215,8 +221,8 @@ char mutable_buffers_type_typedef_helper(
template <typename T, typename Buffer>
struct is_buffer_sequence_class
: integral_constant<bool,
- sizeof(buffer_sequence_begin_helper<T>(0)) != 1 &&
- sizeof(buffer_sequence_end_helper<T>(0)) != 1 &&
+ sizeof(buffer_sequence_begin_helper<T>(0, 0)) != 1 &&
+ sizeof(buffer_sequence_end_helper<T>(0, 0)) != 1 &&
sizeof(buffer_sequence_element_type_helper<T, Buffer>(0, 0)) == 1>
{
};
diff --git a/boost/asio/detail/winrt_ssocket_service.hpp b/boost/asio/detail/winrt_ssocket_service.hpp
index af2c718699..272426939f 100644
--- a/boost/asio/detail/winrt_ssocket_service.hpp
+++ b/boost/asio/detail/winrt_ssocket_service.hpp
@@ -179,6 +179,14 @@ public:
return endpoint;
}
+ // Disable sends or receives on the socket.
+ boost::system::error_code shutdown(implementation_type&,
+ socket_base::shutdown_type, boost::system::error_code& ec)
+ {
+ ec = boost::asio::error::operation_not_supported;
+ return ec;
+ }
+
// Set a socket option.
template <typename Option>
boost::system::error_code set_option(implementation_type& impl,
diff --git a/boost/asio/detail/winrt_ssocket_service_base.hpp b/boost/asio/detail/winrt_ssocket_service_base.hpp
index cb7b6c07f7..9bead3222b 100644
--- a/boost/asio/detail/winrt_ssocket_service_base.hpp
+++ b/boost/asio/detail/winrt_ssocket_service_base.hpp
@@ -169,14 +169,6 @@ public:
return ec;
}
- // Disable sends or receives on the socket.
- boost::system::error_code shutdown(base_implementation_type&,
- socket_base::shutdown_type, boost::system::error_code& ec)
- {
- ec = boost::asio::error::operation_not_supported;
- return ec;
- }
-
// Send the given data to the peer.
template <typename ConstBufferSequence>
std::size_t send(base_implementation_type& impl,