Skip to content

Commit 35ac557

Browse files
Remove dependency on Half, use Float16 instead
1 parent f2776a7 commit 35ac557

File tree

8 files changed

+19
-7
lines changed

8 files changed

+19
-7
lines changed

Package.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let package = Package(
66

77
platforms: [
88
.iOS("9.0"),
9-
.macOS("10.10"),
9+
.macOS(.v11),
1010
.tvOS("9.0"),
1111
.watchOS("2.0")
1212
],
@@ -15,13 +15,11 @@ let package = Package(
1515
.library(name: "CBORCoding", targets: ["CBORCoding"])
1616
],
1717

18-
dependencies: [
19-
.package(url: "https://github.com/SomeRandomiOSDev/Half", from: "1.3.1")
20-
],
18+
dependencies: [],
2119

2220
targets: [
23-
.target(name: "CBORCoding", dependencies: ["Half"]),
24-
.testTarget(name: "CBORCodingTests", dependencies: ["CBORCoding", "Half"])
21+
.target(name: "CBORCoding", dependencies: []),
22+
.testTarget(name: "CBORCodingTests", dependencies: ["CBORCoding"])
2523
],
2624

2725
swiftLanguageVersions: [.version("4.2"), .version("5")]

Sources/CBORCoding/CBORDecoder.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
//
77

88
import Foundation
9+
#if canImport(Half)
910
import Half
11+
#endif
1012

1113
#if canImport(Combine)
1214
import Combine

Sources/CBORCoding/CBOREncoder.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
//
77

88
import Foundation
9+
#if canImport(Half)
910
import Half
11+
#endif
1012

1113
#if canImport(Combine)
1214
import Combine

Sources/CBORCoding/CBORParser.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77

88
import Foundation
9-
import Half
109

1110
// MARK: - CBORParser Definition
1211

Sources/CBORCoding/Half.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Foundation
2+
3+
#if !canImport(Half)
4+
typealias Half = Float16
5+
#endif

Tests/CBORCodingTests/CBORDecoderTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// swiftlint:disable nesting function_body_length force_cast identifier_name opening_brace comma implicitly_unwrapped_optional number_separator force_unwrapping
99

1010
@testable import CBORCoding
11+
#if canImport(Half)
1112
import Half
13+
#endif
1214
import XCTest
1315

1416
// MARK: - CBORDecoderTests Definition

Tests/CBORCodingTests/CBOREncoderTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// swiftlint:disable comma nesting function_body_length identifier_name force_try force_cast number_separator force_unwrapping
99

1010
@testable import CBORCoding
11+
#if canImport(Half)
1112
import Half
13+
#endif
1214
import XCTest
1315

1416
// MARK: - CBORTests Definition

Tests/CBORCodingTests/CBORParserTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// swiftlint:disable function_body_length force_cast comma force_try implicitly_unwrapped_optional number_separator force_unwrapping
99

1010
@testable import CBORCoding
11+
#if canImport(Half)
1112
import Half
13+
#endif
1214
import XCTest
1315

1416
// MARK: - CBORParserTests Definition

0 commit comments

Comments
 (0)