Merge pull request #157 from stephentyrone/float16-availability-redux

Swap availability for #if check on Float16.
This commit is contained in:
Stephen Canon authored and GitHub committed 2020-09-18 16:59:35 -04:00
commit 6b24333510
5 files changed
+8 -13

No files matched your search

+1 -3
View File
@@ -9,12 +9,10 @@
//
//===----------------------------------------------------------------------===//
#if swift(>=5.3)
#if swift(>=5.3) && !(os(macOS) || os(iOS) && targetEnvironment(macCatalyst))
import _NumericsShims
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
@available(macOS, unavailable)
@available(macCatalyst, unavailable)
extension Float16: Real {
@_transparent
public static func cos(_ x: Float16) -> Float16 {
+1 -3
View File
@@ -86,10 +86,8 @@ public protocol FixedWidthFloatingPoint: BinaryFloatingPoint
where Exponent: FixedWidthInteger,
RawSignificand: FixedWidthInteger { }
#if swift(>=5.3)
#if swift(>=5.3) && !(os(macOS) || os(iOS) && targetEnvironment(macCatalyst))
@available(iOS 14.0, watchOS 14.0, tvOS 7.0, *)
@available(macOS, unavailable)
@available(macCatalyst, unavailable)
extension Float16: FixedWidthFloatingPoint { }
#endif
@@ -60,7 +60,7 @@ internal extension Real where Self: BinaryFloatingPoint {
final class ElementaryFunctionChecks: XCTestCase {
#if swift(>=5.3) && !os(macOS)
#if swift(>=5.3) && !(os(macOS) || os(iOS) && targetEnvironment(macCatalyst))
func testFloat16() {
if #available(iOS 14.0, watchOS 14.0, tvOS 7.0, *) {
Float16.elementaryFunctionChecks()
+3 -4
View File
@@ -77,9 +77,8 @@ internal extension Real where Self: FixedWidthFloatingPoint {
}
}
#if swift(>=5.3)
#if swift(>=5.3) && !(os(macOS) || os(iOS) && targetEnvironment(macCatalyst))
@available(iOS 14.0, watchOS 14.0, tvOS 7.0, *)
@available(macOS, unavailable)
extension Float16 {
static func testIntegerExponent() {
testIntegerExponentCommon()
@@ -174,8 +173,8 @@ extension Double {
}
final class IntegerExponentTests: XCTestCase {
#if swift(>=5.3) && !os(macOS)
#if swift(>=5.3) && !(os(macOS) || os(iOS) && targetEnvironment(macCatalyst))
func testFloat16() {
Float16.testIntegerExponent()
}
+2 -2
View File
@@ -32,7 +32,7 @@ extension RealTests.ApproximateEqualityTests {
])
}
#if swift(>=5.3)
#if swift(>=5.3) && !(os(macOS) || os(iOS) && targetEnvironment(macCatalyst))
extension ElementaryFunctionChecks {
static var all = testCase([
("testFloat16", ElementaryFunctionChecks.testFloat16),
@@ -49,7 +49,7 @@ extension ElementaryFunctionChecks {
}
#endif
#if swift(>=5.3)
#if swift(>=5.3) && !(os(macOS) || os(iOS) && targetEnvironment(macCatalyst))
extension IntegerExponentTests {
static var all = testCase([
("testFloat16", IntegerExponentTests.testFloat16),