Skip to content

Commit 129e98b

Browse files
sichanyooChan Yoo
andauthored
feat: Add OS version info to user agent for Linux & Windows (#738)
* Add OS versions logic for Linux. * Delete compiler directives; apple implemented these for us. --------- Co-authored-by: Chan Yoo <[email protected]>
1 parent fdc7a1b commit 129e98b

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

Sources/ClientRuntime/Util/PlatformOperationSystemVersion.swift

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,11 @@
55
// SPDX-License-Identifier: Apache-2.0
66
//
77

8-
#if os(iOS) || os(watchOS) || os(macOS) || os(tvOS)
9-
import Foundation.NSProcessInfo
8+
import class Foundation.ProcessInfo
109

1110
public struct PlatformOperationSystemVersion {
1211
static public func operatingSystemVersion() -> String? {
1312
let osVersion = ProcessInfo.processInfo.operatingSystemVersion
1413
return "\(osVersion.majorVersion).\(osVersion.minorVersion).\(osVersion.patchVersion)"
1514
}
1615
}
17-
#else
18-
// TODO: Implement for Linux & Windows
19-
public struct PlatformOperationSystemVersion {
20-
static public func operatingSystemVersion() -> String? {
21-
return nil
22-
}
23-
}
24-
#endif

0 commit comments

Comments
 (0)