@@ -50,34 +50,46 @@ public func _stdlib_isOSVersionAtLeast(
50
50
/// Returns the version number for the Swift Standard Library that the code
51
51
/// calling this was originally compiled with.
52
52
///
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 )
59
66
}
60
67
61
68
/// Returns the version number for the Swift Standard Library that is currently
62
69
/// loaded.
63
70
///
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.
67
79
@_alwaysEmitIntoClient // Introduced in 5.1
68
- public var _stdlibDynamicVersion : Double {
80
+ public var _stdlibDynamicVersion : ( Int , Int ) {
69
81
if #available( macOS 9999 , iOS 9999 , tvOS 9999 , watchOS 9999 , * ) {
70
82
return _stdlibOpaqueVersion
71
83
}
72
84
else {
73
85
// When linked with the 5.0 stdlib, we return this default value.
74
- return 1000.0
86
+ return ( 1000 , 0 )
75
87
}
76
88
}
77
89
78
90
@available ( macOS 9999 , iOS 9999 , tvOS 9999 , watchOS 9999 , * )
79
91
@usableFromInline
80
- internal var _stdlibOpaqueVersion : Double {
92
+ internal var _stdlibOpaqueVersion : ( Int , Int ) {
81
93
return _stdlibStaticVersion
82
94
}
83
95
0 commit comments