File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,10 @@ if(find_final)
157
157
set (_CXX_COROUTINES_HAVE_HEADER ${_CXX_COROUTINES_HAVE_HEADER_WITH_FLAG} )
158
158
cmake_pop_check_state()
159
159
endif ()
160
+ check_cxx_source_compiles("#include <coroutine> \n typedef std::suspend_never blub; \n int main() {} " _CXX_COROUTINES_FINAL_HEADER_COMPILES)
161
+ if (NOT _CXX_COROUTINES_FINAL_HEADER_COMPILES)
162
+ set (_CXX_COROUTINES_HAVE_HEADER FALSE )
163
+ endif ()
160
164
mark_as_advanced (_CXX_COROUTINES_HAVE_HEADER)
161
165
if (_CXX_COROUTINES_HAVE_HEADER)
162
166
# We found the non-experimental header. Don't bother looking for the
Original file line number Diff line number Diff line change 150
150
# define CPPCORO_CPU_CACHE_LINE 64
151
151
#endif
152
152
153
+ #if CPPCORO_COMPILER_MSVC
154
+ #if __has_include(<coroutine>)
155
+ #include < yvals_core.h>
156
+ #ifdef __cpp_lib_coroutine
157
+ #define CPPCORO_COROHEADER_FOUND_AND_USABLE
158
+ #endif
159
+ #endif
160
+ #else
161
+ #if __has_include(<coroutine>)
162
+ #define CPPCORO_COROHEADER_FOUND_AND_USABLE
163
+ #endif
164
+ #endif
165
+
153
166
#endif
Original file line number Diff line number Diff line change 1
1
#ifndef CPPCORO_COROUTINE_HPP_INCLUDED
2
2
#define CPPCORO_COROUTINE_HPP_INCLUDED
3
3
4
- #if __has_include(<coroutine>)
4
+ #include < cppcoro/config.hpp >
5
5
6
- #include < coroutine>
6
+ #ifdef CPPCORO_COROHEADER_FOUND_AND_USABLE
7
+
8
+ #includue <coroutine>
7
9
8
10
namespace cppcoro {
9
11
using std::coroutine_handle;
You can’t perform that action at this time.
0 commit comments