I am creating a template project and I want to find a way to only use RunLoop if Foundation is already imported (for example when Process is used) and otherwise call dispatchMain() instead. What is the best way to achieve this? Is there some C magic that can resolve this at link/runtime without much overhead? (Assuming FoundationEssentials, Dispatch and Musl/Glibc already imported)
Related Topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Linux equivalent of macOS/iOS run loop, aka libdispatch/Dispatch on Linux | 2 | 1037 | April 5, 2017 | |
getCFRunLoop now internal? | 4 | 172 | October 25, 2024 | |
URLSessionTasks on Windows can cause crashes | 2 | 911 | July 18, 2024 | |
MainActor.assumeIsolated without halting program | 6 | 307 | September 13, 2024 | |
Signal handling in Swift | 12 | 4814 | November 11, 2022 |