Skip to content

Commit

Permalink
Merge pull request #6 from karwa/apple-fixes
Browse files Browse the repository at this point in the history
Fix some availability issues
  • Loading branch information
karwa authored Apr 27, 2022
2 parents 9349111 + fb9243c commit 4a2006f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if settings?.isEmpty == true { settings = nil }

let package = Package(
name: "UniqueID",
platforms: [.macOS(.v10_12), .iOS(.v10) /* for os_unfair_lock */],
platforms: [.macOS(.v10_12), .iOS(.v10), .tvOS(.v10), .watchOS(.v3) /* for os_unfair_lock */],
products: [
.library(
name: "UniqueID",
Expand Down
2 changes: 1 addition & 1 deletion Sources/UniqueID/Time.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@inlinable
internal func _get_system_timestamp() -> UInt64 {
let timestamp: UInt64
if #available(macOS 10.12, *) {
if #available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *) {
var time = timespec()
clock_gettime(CLOCK_REALTIME, &time)
timestamp =
Expand Down
4 changes: 4 additions & 0 deletions Tests/UniqueIDTests/UniqueIDTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ extension UniqueIDTests {

func testCodable() throws {

guard #available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) else {
throw XCTSkip("JSONEncoder.OutputFormatting.sortedKeys requires iOS 11 or newer")
}

struct TypeWithUniqueID: Equatable, Codable {
var name: String
var id: UniqueID
Expand Down

0 comments on commit 4a2006f

Please sign in to comment.