Skip to content

Commit 6116cdf

Browse files
authored
[Data] Fix build issue with Static SDK for Linux. (#1293)
Musl's definition of `S_IFMT` gets imported by the Swift importer, which means Swift can see `S_IFMT` as a `CInt` and also `S_IFMT` from the Swift overlay as a `mode_t`. The upshot is that attempting to convert it to `mode_t` produces an ambiguity error, as Swift doesn't know which definition to use. rdar://147201087
1 parent 26391c9 commit 6116cdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/FoundationEssentials/Data/Data+Reading.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ internal func readBytesFromFile(path inPath: PathOrURL, reportProgress: Bool, ma
336336
}
337337

338338
let fileSize = min(Int(clamping: filestat.st_size), maxLength ?? Int.max)
339-
let fileType = mode_t(filestat.st_mode) & mode_t(S_IFMT)
339+
let fileType = mode_t(filestat.st_mode) & S_IFMT
340340
#if !NO_FILESYSTEM
341341
let shouldMap = shouldMapFileDescriptor(fd, path: inPath, options: options)
342342
#else

0 commit comments

Comments
 (0)