@@ -99,12 +99,13 @@ namespace winrt::impl
9999 return async.GetResults ();
100100 }
101101
102+ #ifdef WINRT_IMPL_COROUTINES
102103 struct ignore_apartment_context {};
103104
104105 template <bool preserve_context, typename Awaiter>
105106 struct disconnect_aware_handler : private std ::conditional_t <preserve_context, resume_apartment_context, ignore_apartment_context>
106107 {
107- disconnect_aware_handler (Awaiter* awaiter, coroutine_handle<> handle) noexcept
108+ disconnect_aware_handler (Awaiter* awaiter, std:: coroutine_handle<> handle) noexcept
108109 : m_awaiter(awaiter), m_handle(handle) { }
109110
110111 disconnect_aware_handler (disconnect_aware_handler&& other) = default ;
@@ -123,7 +124,7 @@ namespace winrt::impl
123124
124125 private:
125126 movable_primitive<Awaiter*> m_awaiter;
126- movable_primitive<coroutine_handle<>, nullptr > m_handle;
127+ movable_primitive<std:: coroutine_handle<>, nullptr > m_handle;
127128
128129 void Complete ()
129130 {
@@ -149,7 +150,6 @@ namespace winrt::impl
149150 }
150151 };
151152
152- #ifdef WINRT_IMPL_COROUTINES
153153 template <typename Async, bool preserve_context = true >
154154 struct await_adapter : cancellable_awaiter<await_adapter<Async, preserve_context>>
155155 {
@@ -175,7 +175,7 @@ namespace winrt::impl
175175 }
176176
177177 template <typename T>
178- bool await_suspend (coroutine_handle<T> handle)
178+ bool await_suspend (std:: coroutine_handle<T> handle)
179179 {
180180 this ->set_cancellable_promise_from_handle (handle);
181181 return register_completed_callback (handle);
@@ -189,7 +189,7 @@ namespace winrt::impl
189189 }
190190
191191 private:
192- bool register_completed_callback (coroutine_handle<> handle)
192+ bool register_completed_callback (std:: coroutine_handle<> handle)
193193 {
194194 if constexpr (!preserve_context)
195195 {
@@ -294,7 +294,6 @@ WINRT_EXPORT namespace winrt::Windows::Foundation
294294 return { async };
295295 }
296296}
297- #endif
298297
299298WINRT_EXPORT namespace winrt
300299{
@@ -327,7 +326,7 @@ namespace winrt::impl
327326 return true ;
328327 }
329328
330- void await_suspend (coroutine_handle<>) const noexcept
329+ void await_suspend (std:: coroutine_handle<>) const noexcept
331330 {
332331 }
333332
@@ -373,7 +372,7 @@ namespace winrt::impl
373372 return true ;
374373 }
375374
376- void await_suspend (coroutine_handle<>) const noexcept
375+ void await_suspend (std:: coroutine_handle<>) const noexcept
377376 {
378377 }
379378
@@ -411,7 +410,7 @@ namespace winrt::impl
411410 if (remaining == 0 )
412411 {
413412 std::atomic_thread_fence (std::memory_order_acquire);
414- coroutine_handle<Derived>::from_promise (*static_cast <Derived*>(this )).destroy ();
413+ std:: coroutine_handle<Derived>::from_promise (*static_cast <Derived*>(this )).destroy ();
415414 }
416415
417416 return remaining;
@@ -577,7 +576,7 @@ namespace winrt::impl
577576 }
578577 }
579578
580- suspend_never initial_suspend () const noexcept
579+ std:: suspend_never initial_suspend () const noexcept
581580 {
582581 return {};
583582 }
@@ -595,7 +594,7 @@ namespace winrt::impl
595594 {
596595 }
597596
598- bool await_suspend (coroutine_handle<>) const noexcept
597+ bool await_suspend (std:: coroutine_handle<>) const noexcept
599598 {
600599 promise->set_completed ();
601600 uint32_t const remaining = promise->subtract_reference ();
@@ -705,11 +704,7 @@ namespace winrt::impl
705704 };
706705}
707706
708- #ifdef __cpp_lib_coroutine
709707namespace std
710- #else
711- namespace std ::experimental
712- #endif
713708{
714709 template <typename ... Args>
715710 struct coroutine_traits <winrt::Windows::Foundation::IAsyncAction, Args...>
@@ -844,7 +839,6 @@ namespace std::experimental
844839
845840WINRT_EXPORT namespace winrt
846841{
847- #ifdef WINRT_IMPL_COROUTINES
848842 template <typename ... T>
849843 Windows::Foundation::IAsyncAction when_all (T... async)
850844 {
@@ -890,5 +884,5 @@ WINRT_EXPORT namespace winrt
890884 impl::check_status_canceled (shared->status );
891885 co_return shared->result .GetResults ();
892886 }
893- #endif
894887}
888+ #endif
0 commit comments