You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I often use GCD on Linux to wrap existing callback-based APIs so they may be better imported by Swift. The GCD headers are present in $prefix/usr/lib/swift/dispatch and .../Block but are not in the include path.
Alternatives considered
rewrite wrappers in Swift; this is a fine long-term solution
use unsafe C flags to amend include path; because unsafe flags break tagged imports, this is not a long-term workable solution
copy and paste necessary headers; this is workable for _Block_copy() and _Block_release() but gets hairy for libdispatch
wrap the headers in new modules; this ultimately creates a module import conflict
Proposed solution
Currently I'm copy pasting declarations in (third alternative solution above), but ideally those headers would be in the include path for C modules built by Swift.
Swift Package Manager version/commit hash
Swift Package Manager - Swift 6.0.2-dev
Swift & OS version (output of swift --version && uname -a)
Swift version 6.0.2 (swift-6.0.2-RELEASE)
Target: aarch64-unknown-linux-gnu
Linux liebling 6.8.0-41-generic #41-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 2 23:26:06 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
The text was updated successfully, but these errors were encountered:
Description
I often use GCD on Linux to wrap existing callback-based APIs so they may be better imported by Swift. The GCD headers are present in
$prefix/usr/lib/swift/dispatch
and.../Block
but are not in the include path.Alternatives considered
_Block_copy()
and_Block_release()
but gets hairy for libdispatchProposed solution
Currently I'm copy pasting declarations in (third alternative solution above), but ideally those headers would be in the include path for C modules built by Swift.
Swift Package Manager version/commit hash
Swift Package Manager - Swift 6.0.2-dev
Swift & OS version (output of
swift --version && uname -a
)The text was updated successfully, but these errors were encountered: