Commit 21929be
authored
Fix FILEPointer typealias for Musl (#491)
Currently, `FILEPointer` is typealiased to `OpaquePointer` for Musl:
```swift
#if os(Android) || canImport(Musl)
public typealias FILEPointer = OpaquePointer
#else
public typealias FILEPointer = UnsafeMutablePointer<FILE>
#endif
```
But building an executable that links against TSCBasic fails:
```
$ ~/Library/Developer/Toolchains/swift-6.0.1-RELEASE.xctoolchain/usr/bin/swift build --swift-sdk x86_64-swift-linux-musl
.build/checkouts/swift-tools-support-core/Sources/TSCBasic/Process/Process.swift:706:70: error: cannot convert value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>') to expected argument type 'FILEPointer' (aka 'OpaquePointer')
704 | throw Process.Error.stdinUnavailable
705 | }
706 | let stdinStream = try LocalFileOutputByteStream(filePointer: fp, closeOnDeinit: true)
| `- error: cannot convert value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>') to expected argument type 'FILEPointer' (aka 'OpaquePointer')
```
But removing the `canImport(Musl)` check allows it to compile without issue, so I assume it was put there for an earlier version of the Musl SDK (or that it was never tested).1 parent 5b130e0 commit 21929be
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
0 commit comments