Skip to content

Commit 1b4c1d3

Browse files
committed
[Data] Fix build issue with Static SDK for Linux.
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 320c583 commit 1b4c1d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/FoundationEssentials/Data/Data+Reading.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ internal func readBytesFromFile(path inPath: PathOrURL, reportProgress: Bool, ma
334334
}
335335

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

0 commit comments

Comments
 (0)