Skip to content

Commit e46c88d

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-next
2 parents 9548beb + 194dba6 commit e46c88d

File tree

5 files changed

+32
-7
lines changed

5 files changed

+32
-7
lines changed

stdlib/public/Darwin/Foundation/NSValue.swift.gyb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ${ ObjectiveCBridgeableImplementationForNSValue("CGSize") }
2424
${ ObjectiveCBridgeableImplementationForNSValue("CGAffineTransform") }
2525

2626
extension NSValue {
27-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
27+
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
2828
public func value<StoredType>(of type: StoredType.Type) -> StoredType? {
2929
if StoredType.self is AnyObject.Type {
3030
let encoding = String(cString: objCType)
@@ -42,11 +42,7 @@ extension NSValue {
4242
}
4343
let allocated = UnsafeMutablePointer<StoredType>.allocate(capacity: 1)
4444
defer { allocated.deallocate() }
45-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
46-
getValue(allocated, size: storedSize)
47-
} else {
48-
getValue(allocated)
49-
}
45+
getValue(allocated, size: storedSize)
5046
return allocated.pointee
5147
}
5248
return nil

stdlib/public/SwiftShims/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ set(sources
4949
NSTimeZoneShims.h
5050
NSUndoManagerShims.h
5151

52+
ClockKitOverlayShims.h
53+
5254
module.modulemap
5355
)
5456
set(output_dir "${SWIFTLIB_DIR}/shims")
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//===--- ClockKitOverlayShims.h --------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#ifndef SWIFT_STDLIB_SHIMS_CLOCKKITOVERLAY_H
14+
#define SWIFT_STDLIB_SHIMS_CLOCKKITOVERLAY_H
15+
16+
@import ClockKit;
17+
18+
@interface CLKTextProvider (OverlaySupport)
19+
+ (CLKTextProvider *)textProviderWithFormat:(NSString *)format arguments:(va_list)arguments API_AVAILABLE(watchos(2.0)) API_UNAVAILABLE(macos, tvos, ios);
20+
@end
21+
22+
// SWIFT_STDLIB_SHIMS_CLOCKKITOVERLAY_H
23+
#endif

stdlib/public/SwiftShims/module.modulemap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,7 @@ module _SwiftFoundationOverlayShims {
7171
module _SwiftNetworkOverlayShims {
7272
header "NetworkOverlayShims.h"
7373
}
74+
75+
module _SwiftClockKitOverlayShims {
76+
header "ClockKitOverlayShims.h"
77+
}

test/stdlib/NSValueBridging.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ nsValueBridging.test("NSValue can only be cast back to its original type") {
9292
}
9393

9494
nsValueBridging.test("NSValue fetching method should be able to convert constructed values safely") {
95-
guard #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) else { return }
95+
guard #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) else { return }
9696

9797
let range = NSRange(location: 17, length: 38)
9898
let value = NSValue(range: range)

0 commit comments

Comments
 (0)