Skip to content

Commit c28d453

Browse files
committed
Merge asio 1.32.0 from 'develop'.
2 parents 2aac165 + d6e7b5a commit c28d453

35 files changed

+164
-108
lines changed

doc/history.qbk

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,30 @@
77

88
[section:history Revision History]
99

10-
[heading Asio 1.31.0 / Boost 1.86 beta]
10+
[heading Asio 1.32.0 / Boost 1.86]
11+
12+
* Fixed an issue in `co_composed` caused by a missing `decay`.
13+
* Fixed an issue in `co_composed` due to a missing reference in a cast to a base
14+
class type.
15+
* Changed to use the standard C++20 coroutine feature test macro by default.
16+
* Changed to use `std::aligned_alloc` on Android, when available.
17+
* Fixed an integer conversion warning in `ip::address_v6`, on iOS/tvOS.
18+
* Added missing include of `<malloc.h>` required for `_alloca`.
19+
* Changed to use a standard feature test macro to check if the standard library
20+
supports `std::invoke_result`.
21+
* Fixed handling of `file_base::append` in Windows file support.
22+
* Fixed some warnings in IP address to string conversion.
23+
* Added support for using `co_spawn` when exceptions are disabled.
24+
* Fixed `spawn.hpp` header to be self-contained.
25+
* Enabled TLS v1.3 options for WolfSSL.
26+
* Fixed `experimental::coro` implementation to use the correct cancellation
27+
slot.
28+
* Fixed `io_context::strand::wrap()` so that its return value has an associated
29+
executor.
30+
* Marked `constexpr` global variables as `inline`.
31+
* Documentation fixes.
32+
33+
[heading Asio 1.31.0]
1134

1235
* Changed the `default_completion_token` trait's primary template to select
1336
`deferred` as the default completion token. As a result, most asynchronous

doc/overview/cancellation.qbk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ occur.
201201

202202
Furthermore, a stronger guarantee always satisfies the requirements of a weaker
203203
guarantee. The `partial` guarantee still satisfies the `terminal` guarantee.
204-
The `total` guarantee satisfies both `partial` and `total`. This means that
204+
The `total` guarantee satisfies both `partial` and `terminal`. This means that
205205
when an operation supports a given cancellation type as its strongest
206206
guarantee, it should honour cancellation requests for any of the weaker
207207
guarantees.

doc/reference.dox

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ PREDEFINED = GENERATING_DOCUMENTATION \
317317
BOOST_ASIO_CONSTEXPR=constexpr \
318318
BOOST_ASIO_NOEXCEPT=noexcept \
319319
BOOST_ASIO_NODISCARD= \
320+
BOOST_ASIO_INLINE_VARIABLE= \
320321
BOOST_ASIO_COMPLETION_SIGNATURE=typename \
321322
BOOST_ASIO_COMPLETION_HANDLER_FOR(s)=typename \
322323
BOOST_ASIO_COMPLETION_TOKEN_FOR(s)=typename \

doc/tutorial.qbk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,11 @@ Just as it would with a call from a single thread, concurrent calls to boost::as
653653
``''''''`` boost::asio::io_context io;
654654
``''''''`` printer p(io);
655655
``''''''`` std::thread t([&]{ io.run(); });
656+
``''''''`` io.run();
657+
``''''''`` t.join();
658+
659+
``''''''`` return 0;
660+
``''''''``}
656661

657662
See the [link boost_asio.tutorial.tuttimer5.src full source listing]
658663

example/cpp11/tutorial/timer_dox.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ boost::asio::io_context::run() will continue to execute while there is "work" le
365365
do. The background thread will not exit until all asynchronous operations have
366366
completed.
367367

368+
\until join
368369
\until }
369370

370371
See the \ref tuttimer5src "full source listing" \n

include/boost/asio/as_tuple.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ struct partial_as_tuple
142142
* asynchronous operation's default completion token (or boost::asio::deferred
143143
* if no default is available).
144144
*/
145-
constexpr partial_as_tuple as_tuple;
145+
BOOST_ASIO_INLINE_VARIABLE constexpr partial_as_tuple as_tuple;
146146

147147
} // namespace asio
148148
} // namespace boost

include/boost/asio/co_composed.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ class co_composed_promise
963963

964964
Handler handler(std::move(a.promise_.state_.handler_));
965965
std::tuple<decay_t<Args>...> result(
966-
std::move(static_cast<std::tuple<Args&&...>>(a.result_)));
966+
std::move(static_cast<std::tuple<Args&&...>&>(a.result_)));
967967

968968
co_composed_handler_base<Executors, Handler,
969969
Return>(std::move(composed_handler));
@@ -1104,7 +1104,7 @@ class initiate_co_composed<Implementation, void(), Signatures...>
11041104
};
11051105

11061106
template <typename... Signatures, typename Implementation, typename Executors>
1107-
inline initiate_co_composed<Implementation, Executors, Signatures...>
1107+
inline initiate_co_composed<decay_t<Implementation>, Executors, Signatures...>
11081108
make_initiate_co_composed(Implementation&& implementation,
11091109
composed_io_executors<Executors>&& executors)
11101110
{

include/boost/asio/deferred.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ inline auto operator|(Head head, Tail&& tail)
709709
/**
710710
* See the documentation for boost::asio::deferred_t for a usage example.
711711
*/
712-
constexpr deferred_t deferred;
712+
BOOST_ASIO_INLINE_VARIABLE constexpr deferred_t deferred;
713713

714714
} // namespace asio
715715
} // namespace boost

include/boost/asio/detached.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class detached_t
9595
/**
9696
* See the documentation for boost::asio::detached_t for a usage example.
9797
*/
98-
constexpr detached_t detached;
98+
BOOST_ASIO_INLINE_VARIABLE constexpr detached_t detached;
9999

100100
} // namespace asio
101101
} // namespace boost

include/boost/asio/detail/config.hpp

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,19 @@
341341
# endif // !defined(BOOST_ASIO_DISABLE_VARIADIC_LAMBDA_CAPTURES)
342342
#endif // !defined(BOOST_ASIO_HAS_VARIADIC_LAMBDA_CAPTURES)
343343

344+
// Support for inline variables.
345+
#if !defined(BOOST_ASIO_HAS_INLINE_VARIABLES)
346+
# if !defined(BOOST_ASIO_DISABLE_INLINE_VARIABLES)
347+
# if (__cplusplus >= 201703) && (__cpp_inline_variables >= 201606)
348+
# define BOOST_ASIO_HAS_INLINE_VARIABLES 1
349+
# define BOOST_ASIO_INLINE_VARIABLE inline
350+
# endif // (__cplusplus >= 201703) && (__cpp_inline_variables >= 201606)
351+
# endif // !defined(BOOST_ASIO_DISABLE_INLINE_VARIABLES)
352+
#endif // !defined(BOOST_ASIO_HAS_INLINE_VARIABLES)
353+
#if !defined(BOOST_ASIO_INLINE_VARIABLE)
354+
# define BOOST_ASIO_INLINE_VARIABLE
355+
#endif // !defined(BOOST_ASIO_INLINE_VARIABLE)
356+
344357
// Default alignment.
345358
#if defined(__STDCPP_DEFAULT_NEW_ALIGNMENT__)
346359
# define BOOST_ASIO_DEFAULT_ALIGN __STDCPP_DEFAULT_NEW_ALIGNMENT__
@@ -362,7 +375,9 @@
362375
# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
363376
# if (_LIBCPP_STD_VER > 14) && defined(_LIBCPP_HAS_ALIGNED_ALLOC) \
364377
&& !defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__)
365-
# if defined(__APPLE__)
378+
# if defined(__ANDROID__) && (__ANDROID_API__ >= 28)
379+
# define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
380+
# elif defined(__APPLE__)
366381
# if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
367382
# if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
368383
# define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
@@ -532,9 +547,9 @@
532547
# define BOOST_ASIO_HAS_STD_INVOKE_RESULT 1
533548
# endif // (_MSC_VER >= 1911 && _MSVC_LANG >= 201703)
534549
# else // defined(BOOST_ASIO_MSVC)
535-
# if (__cplusplus >= 201703)
550+
# if (__cplusplus >= 201703) && (__cpp_lib_is_invocable >= 201703)
536551
# define BOOST_ASIO_HAS_STD_INVOKE_RESULT 1
537-
# endif // (__cplusplus >= 201703)
552+
# endif // (__cplusplus >= 201703) && (__cpp_lib_is_invocable >= 201703)
538553
# endif // defined(BOOST_ASIO_MSVC)
539554
# endif // !defined(BOOST_ASIO_DISABLE_STD_INVOKE_RESULT)
540555
#endif // !defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT)
@@ -1275,7 +1290,10 @@
12751290
// Support the co_await keyword on compilers known to allow it.
12761291
#if !defined(BOOST_ASIO_HAS_CO_AWAIT)
12771292
# if !defined(BOOST_ASIO_DISABLE_CO_AWAIT)
1278-
# if defined(BOOST_ASIO_MSVC)
1293+
# if (__cplusplus >= 202002) \
1294+
&& (__cpp_impl_coroutine >= 201902) && (__cpp_lib_coroutine >= 201902)
1295+
# define BOOST_ASIO_HAS_CO_AWAIT 1
1296+
# elif defined(BOOST_ASIO_MSVC)
12791297
# if (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705) && !defined(__clang__)
12801298
# define BOOST_ASIO_HAS_CO_AWAIT 1
12811299
# elif (_MSC_FULL_VER >= 190023506)
@@ -1386,11 +1404,9 @@
13861404
// Standard library support for snprintf.
13871405
#if !defined(BOOST_ASIO_HAS_SNPRINTF)
13881406
# if !defined(BOOST_ASIO_DISABLE_SNPRINTF)
1389-
# if defined(__apple_build_version__)
1390-
# if (__clang_major__ >= 14)
1391-
# define BOOST_ASIO_HAS_SNPRINTF 1
1392-
# endif // (__clang_major__ >= 14)
1393-
# endif // defined(__apple_build_version__)
1407+
# if defined(__APPLE__)
1408+
# define BOOST_ASIO_HAS_SNPRINTF 1
1409+
# endif // defined(__APPLE__)
13941410
# endif // !defined(BOOST_ASIO_DISABLE_SNPRINTF)
13951411
#endif // !defined(BOOST_ASIO_HAS_SNPRINTF)
13961412

0 commit comments

Comments
 (0)