From 25adc7111a2138de636b6deb53af406e12e42c8e Mon Sep 17 00:00:00 2001 From: ksherlock Date: Sun, 14 Nov 2021 13:46:10 -0500 Subject: [PATCH] clang __cpp_coroutines check undefined error With `-Werror` and `-Wundef`, the `clang` `__cpp_coroutines` check can cause an error. (error: '__cpp_coroutines' is not defined, evaluates to 0 [-Werror,-Wundef]) Presumably the gcc `__cpp_impl_coroutine` check would also suffer from this issue. Error encountered with Apple clang version 11.0.0 (clang-1100.0.33.17) --- include/boost/asio/detail/config.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/boost/asio/detail/config.hpp b/include/boost/asio/detail/config.hpp index 65f598c557..596a977ea7 100644 --- a/include/boost/asio/detail/config.hpp +++ b/include/boost/asio/detail/config.hpp @@ -1897,17 +1897,17 @@ # endif // defined(_RESUMABLE_FUNCTIONS_SUPPORTED) # endif // (_MSC_FULL_VER >= 190023506) # elif defined(__clang__) -# if (__cplusplus >= 201703) && (__cpp_coroutines >= 201703) +# if (__cplusplus >= 201703) && defined(__cpp_coroutines) && (__cpp_coroutines >= 201703) # if __has_include() # define BOOST_ASIO_HAS_CO_AWAIT 1 # endif // __has_include() -# endif // (__cplusplus >= 201703) && (__cpp_coroutines >= 201703) +# endif // (__cplusplus >= 201703) && defined(__cpp_coroutines) && (__cpp_coroutines >= 201703) # elif defined(__GNUC__) -# if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902) +# if (__cplusplus >= 201709) && defined(__cpp_impl_coroutine) && (__cpp_impl_coroutine >= 201902) # if __has_include() # define BOOST_ASIO_HAS_CO_AWAIT 1 # endif // __has_include() -# endif // (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902) +# endif // (__cplusplus >= 201709) && defined(__cpp_impl_coroutine) && (__cpp_impl_coroutine >= 201902) # endif // defined(__GNUC__) # endif // !defined(BOOST_ASIO_DISABLE_CO_AWAIT) #endif // !defined(BOOST_ASIO_HAS_CO_AWAIT) @@ -1921,11 +1921,11 @@ # endif // (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705) # endif // defined(BOOST_ASIO_MSVC) # if defined(__GNUC__) -# if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902) +# if (__cplusplus >= 201709) && defined(__cpp_impl_coroutine) && (__cpp_impl_coroutine >= 201902) # if __has_include() # define BOOST_ASIO_HAS_STD_COROUTINE 1 # endif // __has_include() -# endif // (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902) +# endif // (__cplusplus >= 201709) && defined(__cpp_impl_coroutine) && (__cpp_impl_coroutine >= 201902) # endif // defined(__GNUC__) # endif // !defined(BOOST_ASIO_DISABLE_STD_COROUTINE) #endif // !defined(BOOST_ASIO_HAS_STD_COROUTINE)