chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.72k stars 1.19k forks source link

using clang on windows failed to define some macro of asio #1486

Open kiraYuukiAsuna opened 4 weeks ago

kiraYuukiAsuna commented 4 weeks ago

take ASIO_HAS_CO_AWAIT for example:

if defined(ASIO_MSVC)
#   if (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705) && !defined(__clang__)
#    define ASIO_HAS_CO_AWAIT 1
#   elif (_MSC_FULL_VER >= 190023506)
#    if !defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
#     define ASIO_HAS_CO_AWAIT 1
#    endif // defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
#   endif // (_MSC_FULL_VER >= 190023506)
#  elif defined(__clang__)

Since i use clang to compile my code, and as we know that clang on windows need to use msvc's header and library. This caused clang and _MSC_VER defined at the same time. Thus caused ASIO_HAS_CO_AWAIT not defined at config.hpp in asio library.

Can we handle this particularly circumstance?

Anyway, thanks for this awesome library!