We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f13167d + 472e842 commit 3cf257fCopy full SHA for 3cf257f
stdlib/public/Concurrency/Task.cpp
@@ -560,11 +560,17 @@ void swift::swift_task_asyncMainDrainQueue() {
560
561
pfndispatch_main();
562
#else
563
+ // CFRunLoop is not available on non-Darwin targets. Foundation has an
564
+ // implementation, but CoreFoundation is not meant to be exposed. We can only
565
+ // assume the existence of `CFRunLoopRun` on Darwin platforms, where the
566
+ // system provides an implementation of CoreFoundation.
567
+#if defined(__APPLE__)
568
auto runLoop =
569
reinterpret_cast<void (*)(void)>(dlsym(RTLD_DEFAULT, "CFRunLoopRun"));
570
if (runLoop)
- runLoop();
- else
571
+ return runLoop();
572
+#endif
573
+
574
dispatch_main();
575
#endif
576
0 commit comments