Skip to content

Commit 6da5baa

Browse files
authored
Adjust compiler version checks around WinSDK.GUID.Wrapper. (#1483)
This PR ensures we don't start spuriously warning if Swift Testing is built as a package with the (eventual/hypothetical) Swift 6.3.1 toolchain, and uses the built-in `Equatable` and `Hashable` conformances on `GUID` when built with 6.3.0 (because those conformances have landed everywhere now.) ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
1 parent 9e0b757 commit 6da5baa

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Sources/Overlays/_Testing_WinSDK/Support/Additions/GUIDAdditions.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extension GUID {
1717
///
1818
/// - Bug: This type will become obsolete once we can use the `Equatable` and
1919
/// `Hashable` conformances added to the WinSDK module in Swift 6.3.
20-
#if compiler(>=6.3.1) && DEBUG
20+
#if compiler(>=6.4) && DEBUG
2121
@available(*, deprecated, message: "GUID.Wrapper is no longer needed and can be removed.")
2222
#endif
2323
struct Wrapper: Sendable, RawRepresentable {
@@ -32,7 +32,7 @@ extension GUID.Wrapper: Equatable, Hashable, CustomStringConvertible {
3232
self.init(rawValue: rawValue)
3333
}
3434

35-
#if compiler(<6.3.1)
35+
#if compiler(<6.3)
3636
private var _uint128Value: UInt128 {
3737
withUnsafeBytes(of: rawValue) { buffer in
3838
buffer.baseAddress!.loadUnaligned(as: UInt128.self)
@@ -46,10 +46,10 @@ extension GUID.Wrapper: Equatable, Hashable, CustomStringConvertible {
4646
func hash(into hasher: inout Hasher) {
4747
hasher.combine(_uint128Value)
4848
}
49+
#endif
4950

5051
var description: String {
5152
String(describing: rawValue)
5253
}
53-
#endif
5454
}
5555
#endif

0 commit comments

Comments
 (0)