Skip to content

Commit 6b24333

Browse files
Merge pull request #157 from stephentyrone/float16-availability-redux
Swap availability for #if check on Float16.
2 parents 3d7462a + e07b394 commit 6b24333

File tree

5 files changed

+8
-13
lines changed

5 files changed

+8
-13
lines changed

Sources/RealModule/Float16+Real.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
#if swift(>=5.3)
12+
#if swift(>=5.3) && !(os(macOS) || os(iOS) && targetEnvironment(macCatalyst))
1313
import _NumericsShims
1414

1515
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
16-
@available(macOS, unavailable)
17-
@available(macCatalyst, unavailable)
1816
extension Float16: Real {
1917
@_transparent
2018
public static func cos(_ x: Float16) -> Float16 {

Sources/_TestSupport/RealTestSupport.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,8 @@ public protocol FixedWidthFloatingPoint: BinaryFloatingPoint
8686
where Exponent: FixedWidthInteger,
8787
RawSignificand: FixedWidthInteger { }
8888

89-
#if swift(>=5.3)
89+
#if swift(>=5.3) && !(os(macOS) || os(iOS) && targetEnvironment(macCatalyst))
9090
@available(iOS 14.0, watchOS 14.0, tvOS 7.0, *)
91-
@available(macOS, unavailable)
92-
@available(macCatalyst, unavailable)
9391
extension Float16: FixedWidthFloatingPoint { }
9492
#endif
9593

Tests/RealTests/ElementaryFunctionChecks.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ internal extension Real where Self: BinaryFloatingPoint {
6060

6161
final class ElementaryFunctionChecks: XCTestCase {
6262

63-
#if swift(>=5.3) && !os(macOS)
63+
#if swift(>=5.3) && !(os(macOS) || os(iOS) && targetEnvironment(macCatalyst))
6464
func testFloat16() {
6565
if #available(iOS 14.0, watchOS 14.0, tvOS 7.0, *) {
6666
Float16.elementaryFunctionChecks()

Tests/RealTests/IntegerExponentTests.swift

+3-4
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,8 @@ internal extension Real where Self: FixedWidthFloatingPoint {
7777
}
7878
}
7979

80-
#if swift(>=5.3)
80+
#if swift(>=5.3) && !(os(macOS) || os(iOS) && targetEnvironment(macCatalyst))
8181
@available(iOS 14.0, watchOS 14.0, tvOS 7.0, *)
82-
@available(macOS, unavailable)
8382
extension Float16 {
8483
static func testIntegerExponent() {
8584
testIntegerExponentCommon()
@@ -174,8 +173,8 @@ extension Double {
174173
}
175174

176175
final class IntegerExponentTests: XCTestCase {
177-
178-
#if swift(>=5.3) && !os(macOS)
176+
177+
#if swift(>=5.3) && !(os(macOS) || os(iOS) && targetEnvironment(macCatalyst))
179178
func testFloat16() {
180179
Float16.testIntegerExponent()
181180
}

Tests/WindowsMain.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extension RealTests.ApproximateEqualityTests {
3232
])
3333
}
3434

35-
#if swift(>=5.3)
35+
#if swift(>=5.3) && !(os(macOS) || os(iOS) && targetEnvironment(macCatalyst))
3636
extension ElementaryFunctionChecks {
3737
static var all = testCase([
3838
("testFloat16", ElementaryFunctionChecks.testFloat16),
@@ -49,7 +49,7 @@ extension ElementaryFunctionChecks {
4949
}
5050
#endif
5151

52-
#if swift(>=5.3)
52+
#if swift(>=5.3) && !(os(macOS) || os(iOS) && targetEnvironment(macCatalyst))
5353
extension IntegerExponentTests {
5454
static var all = testCase([
5555
("testFloat16", IntegerExponentTests.testFloat16),

0 commit comments

Comments
 (0)