From 6a686d207bbadd61f8402f30192103a3fe9dfa80 Mon Sep 17 00:00:00 2001 From: Keeyou Date: Thu, 10 Oct 2024 09:51:16 +0800 Subject: [PATCH 1/2] Support co_composed under ASIO_NO_EXCEPTIONS --- include/asio/co_composed.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/asio/co_composed.hpp b/include/asio/co_composed.hpp index f54d0a20ff..1358d2be7b 100644 --- a/include/asio/co_composed.hpp +++ b/include/asio/co_composed.hpp @@ -843,7 +843,11 @@ class co_composed_promise { if (owner_) *owner_ = this; +#if !defined(ASIO_NO_EXCEPTIONS) throw; +#else + ::abort(); +#endif } template From b46fd9904246a382d1c3fb7ff968226cab5383ce Mon Sep 17 00:00:00 2001 From: Keeyou Date: Thu, 10 Oct 2024 10:36:11 +0800 Subject: [PATCH 2/2] Support msvc build with clang --- include/asio/detail/config.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/asio/detail/config.hpp b/include/asio/detail/config.hpp index 5a3d2526fc..c0ad8590fa 100644 --- a/include/asio/detail/config.hpp +++ b/include/asio/detail/config.hpp @@ -1446,11 +1446,7 @@ // Standard library support for coroutines. #if !defined(ASIO_HAS_STD_COROUTINE) # if !defined(ASIO_DISABLE_STD_COROUTINE) -# if defined(ASIO_MSVC) -# if (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705) -# define ASIO_HAS_STD_COROUTINE 1 -# endif // (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705) -# elif defined(__clang__) +# if defined(__clang__) # if (__clang_major__ >= 14) # if (__cplusplus >= 202002) && (__cpp_impl_coroutine >= 201902) # if __has_include() @@ -1465,6 +1461,11 @@ # endif // __has_include() # endif // (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902) # endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705) +# define ASIO_HAS_STD_COROUTINE 1 +# endif // (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705) +# endif // defined(ASIO_MSVC) # endif // !defined(ASIO_DISABLE_STD_COROUTINE) #endif // !defined(ASIO_HAS_STD_COROUTINE)