asio icon indicating copy to clipboard operation
asio copied to clipboard

asio config does not detect coroutine support with clang-cl as compiler

Open Febbe opened this issue 2 years ago • 2 comments

When compiling ASIO via clang-cl version 15.0 on Windows, the ASIO config sets ASIO_HAS_CO_AWAIT to zero, even if clang actually has it.

The reason is in line 2024: if (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705) && !defined(__clang__)

My proposed solution is to use the <version> header. And check for #if defined(__cpp_lib_coroutine) && __cpp_lib_coroutine == 201902L

Febbe avatar Oct 06 '22 13:10 Febbe

It works if you use libc++ by setting -stdlib=libc++.

klemens-morgenstern avatar Oct 18 '22 08:10 klemens-morgenstern

It works if you use libc++ by setting -stdlib=libc++.

Thank you, but not every one can change the STL :/. This might work in some cases for clangd users. But not for the hole project itself, for example.

Febbe avatar Oct 18 '22 14:10 Febbe