13
13
import SwiftShims
14
14
15
15
#if INTERNAL_CHECKS_ENABLED
16
- @available ( macOS 12 . 0 , iOS 15 . 0 , watchOS 8 . 0 , tvOS 15 . 0 , * )
16
+ // "9999" means: enable if linked with a built library, but not when linked with
17
+ // the OS libraries.
18
+ // Note: this must not be changed to a "real" OS version.
19
+ @available ( macOS 9999 , iOS 9999 , tvOS 9999 , watchOS 9999 , * )
17
20
@_silgen_name ( " swift_COWChecksEnabled " )
18
21
public func _COWChecksEnabled( ) -> Bool
19
22
#endif
@@ -460,15 +463,21 @@ internal struct _ContiguousArrayBuffer<Element>: _ArrayBufferProtocol {
460
463
@_alwaysEmitIntoClient
461
464
internal var isImmutable : Bool {
462
465
get {
463
- if #available( macOS 12 . 0 , iOS 15 . 0 , watchOS 8 . 0 , tvOS 15 . 0 , * ) {
466
+ // "9999" means: enable if linked with a built library, but not when
467
+ // linked with the OS libraries.
468
+ // Note: this must not be changed to a "real" OS version.
469
+ if #available( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * ) {
464
470
if ( _COWChecksEnabled ( ) ) {
465
471
return capacity == 0 || _swift_isImmutableCOWBuffer ( _storage)
466
472
}
467
473
}
468
474
return true
469
475
}
470
476
nonmutating set {
471
- if #available( macOS 12 . 0 , iOS 15 . 0 , watchOS 8 . 0 , tvOS 15 . 0 , * ) {
477
+ // "9999" means: enable if linked with a built library, but not when
478
+ // linked with the OS libraries.
479
+ // Note: this must not be changed to a "real" OS version.
480
+ if #available( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * ) {
472
481
if ( _COWChecksEnabled ( ) ) {
473
482
// Make sure to not modify the empty array singleton (which has a
474
483
// capacity of 0).
@@ -489,7 +498,10 @@ internal struct _ContiguousArrayBuffer<Element>: _ArrayBufferProtocol {
489
498
490
499
@_alwaysEmitIntoClient
491
500
internal var isMutable : Bool {
492
- if #available( macOS 12 . 0 , iOS 15 . 0 , watchOS 8 . 0 , tvOS 15 . 0 , * ) {
501
+ // "9999" means: enable if linked with a built library, but not when
502
+ // linked with the OS libraries.
503
+ // Note: this must not be changed to a "real" OS version.
504
+ if #available( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * ) {
493
505
if ( _COWChecksEnabled ( ) ) {
494
506
return !_swift_isImmutableCOWBuffer( _storage)
495
507
}
0 commit comments