Commit e9440ced authored by Lewis Baker's avatar Lewis Baker Committed by Facebook Github Bot

Don't enable FOLLY_HAS_COROUTINES under MSVC or pre-C++17

Summary:
The folly::coro functionality depends heavily on the symmetric-transfer capability of coroutines which MSVC does not yet support.

The folly/Portability.h header was previously defining FOLLY_HAS_COROUTINES to true for MSVC even though you would get compile errors if you tried to use any of the folly::coro facilities.

Also further restrict defining FOLLY_HAS_COROUTINES only when C++17 or later is available as folly::coro makes use of C++17 language features.

Reviewed By: yfeldblum, andriigrynenko

Differential Revision: D14811921

fbshipit-source-id: f3da2d3c07fc9ebe08f566a7707c62e74e412df9
parent 8c0d65fe
......@@ -473,11 +473,15 @@ constexpr auto kCpplibVer = 0;
#define FOLLY_STORAGE_CONSTEXPR constexpr
#endif
#if __cplusplus >= 201703L
// folly::coro requires C++17 support
#if __cpp_coroutines >= 201703L && __has_include(<experimental/coroutine>)
#define FOLLY_HAS_COROUTINES 1
#elif _MSC_VER && _RESUMABLE_FUNCTIONS_SUPPORTED
#define FOLLY_HAS_COROUTINES 1
// NOTE: MSVC 2017 does not currently support the full Coroutines TS since it
// does not yet support symmetric-transfer.
#endif
#endif // __cplusplus >= 201703L
// MSVC 2017.5 && C++17
#if __cpp_noexcept_function_type >= 201510 || \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment