Skip to content

Commit 3eaf583

Browse files
committed
Resolve availability warnings / fix non-Darwin build
1 parent bba6176 commit 3eaf583

File tree

10 files changed

+29
-0
lines changed

10 files changed

+29
-0
lines changed

Sources/FoundationEssentials/Data/Data+Deprecated.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
1314
extension Data {
1415
@available(swift, introduced: 4.2)
1516
@available(swift, deprecated: 5, message: "use `init(_:)` instead")

Sources/FoundationEssentials/Data/Data+Iterator.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
1314
extension Data {
1415
/// An iterator over the contents of the data.
1516
///

Sources/FoundationEssentials/Data/Data+Reading.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ private func readBytesFromFileDescriptor(_ fd: Int32, path: PathOrURL, buffer in
514514
return length - numBytesRemaining
515515
}
516516

517+
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
517518
extension Data {
518519
#if FOUNDATION_FRAMEWORK
519520
public typealias ReadingOptions = NSData.ReadingOptions

Sources/FoundationEssentials/Data/Data+Searching.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
1314
extension Data {
1415
#if FOUNDATION_FRAMEWORK
1516
public typealias SearchOptions = NSData.SearchOptions

Sources/FoundationEssentials/Data/Data+Writing.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,7 @@ private func writeExtendedAttributes(fd: Int32, attributes: [String : Data]) {
722722
}
723723
#endif // !NO_FILESYSTEM
724724

725+
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
725726
extension Data {
726727
#if FOUNDATION_FRAMEWORK
727728
public typealias WritingOptions = NSData.WritingOptions

Sources/FoundationEssentials/Data/Representations/Data+Inline.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#if canImport(Glibc)
14+
@preconcurrency import Glibc
15+
#elseif canImport(Musl)
16+
@preconcurrency import Musl
17+
#elseif canImport(ucrt)
18+
import ucrt
19+
#elseif canImport(WASILibc)
20+
@preconcurrency import WASILibc
21+
#endif
22+
23+
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
1324
extension Data {
1425
// A small inline buffer of bytes suitable for stack-allocation of small data.
1526
// Inlinability strategy: everything here should be inlined for direct operation on the stack wherever possible.

Sources/FoundationEssentials/Data/Representations/Data+InlineSlice.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
1314
extension Data {
1415
#if _pointerBitWidth(_64)
1516
@usableFromInline internal typealias HalfInt = Int32

Sources/FoundationEssentials/Data/Representations/Data+LargeSlice.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
1314
extension Data {
1415
// A reference wrapper around a Range<Int> for when the range of a data buffer is too large to whole in a single word.
1516
// Inlinability strategy: everything should be inlinable as trivial.

Sources/FoundationEssentials/Data/Representations/Data+Representation.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
1314
extension Data {
1415
// The actual storage for Data's various representations.
1516
// Inlinability strategy: almost everything should be inlinable as forwarding the underlying implementations. (Inlining can also help avoid retain-release traffic around pulling values out of enums.)

Sources/FoundationEssentials/Data/Representations/DataStorage.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#if canImport(Glibc)
14+
@preconcurrency import Glibc
15+
#elseif canImport(Musl)
16+
@preconcurrency import Musl
17+
#elseif canImport(ucrt)
18+
import ucrt
19+
#elseif canImport(WASILibc)
20+
@preconcurrency import WASILibc
21+
#endif
22+
1323
// Underlying storage representation for medium and large data.
1424
// Inlinability strategy: methods from here should not inline into InlineSlice or LargeSlice unless trivial.
1525
// NOTE: older overlays called this class _DataStorage. The two must

0 commit comments

Comments
 (0)