Skip to content

Commit 65728ea

Browse files
committed
[squash] Use a pair integers rather than a single Double
1 parent 309e564 commit 65728ea

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

stdlib/public/core/Availability.swift

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,34 +50,46 @@ public func _stdlib_isOSVersionAtLeast(
5050
/// Returns the version number for the Swift Standard Library that the code
5151
/// calling this was originally compiled with.
5252
///
53-
/// The version number is an arbitrary `Double` value that is monotonically
54-
/// increasing between toolchain releases. It does not correlate with toolchain
55-
/// or OS version numbers, and it is not a semantic version number.
56-
@_alwaysEmitIntoClient @_transparent
57-
public var _stdlibStaticVersion: Double {
58-
return 1001.0
53+
/// The version number is an arbitrary pair of integers, with lexicographical
54+
/// ordering. Version numbers of (logically) successive stdlib releases form a
55+
/// monotonically increasing sequence; i.e., versions should not decrease, but
56+
/// they are allowed to stay the same.
57+
///
58+
/// The two integer components are not intended to correspond to major or minor
59+
/// versions in a semantic versioning scheme. Neither do they correlate with
60+
/// toolchain or OS version numbers.
61+
@_alwaysEmitIntoClient
62+
public var _stdlibStaticVersion: (Int, Int) {
63+
// On the master branch, increment the first number.
64+
// On release branches, increment the second number.
65+
return (1001, 0)
5966
}
6067

6168
/// Returns the version number for the Swift Standard Library that is currently
6269
/// loaded.
6370
///
64-
/// The version number is an arbitrary `Double` value that is monotonically
65-
/// increasing between toolchain releases. It does not correlate with toolchain
66-
/// or OS version numbers, and it is not a semantic version number.
71+
/// The version number is an arbitrary pair of integers, with lexicographical
72+
/// ordering. Version numbers of (logically) successive stdlib releases form a
73+
/// monotonically increasing sequence; i.e., versions should not decrease, but
74+
/// they are allowed to stay the same.
75+
///
76+
/// The two integer components are not intended to correspond to major or minor
77+
/// versions in a semantic versioning scheme. Neither do they correlate with
78+
/// toolchain or OS version numbers.
6779
@_alwaysEmitIntoClient // Introduced in 5.1
68-
public var _stdlibDynamicVersion: Double {
80+
public var _stdlibDynamicVersion: (Int, Int) {
6981
if #available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) {
7082
return _stdlibOpaqueVersion
7183
}
7284
else {
7385
// When linked with the 5.0 stdlib, we return this default value.
74-
return 1000.0
86+
return (1000, 0)
7587
}
7688
}
7789

7890
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
7991
@usableFromInline
80-
internal var _stdlibOpaqueVersion: Double {
92+
internal var _stdlibOpaqueVersion: (Int, Int) {
8193
return _stdlibStaticVersion
8294
}
8395

0 commit comments

Comments
 (0)