mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Gardening] Clean Up OS-Test Patterns Across The Codebase
Clean up a few general patterns that are now obviated by canImport This aligns more generally with the cleanup that the Swift Package Manager has already done in their automated XCTest-plumbing tool in apple/swift-package-manager#1826.
This commit is contained in:
@@ -1368,7 +1368,7 @@ NSStringAPIs.test("smallestEncoding") {
|
||||
func getHomeDir() -> String {
|
||||
#if os(macOS)
|
||||
return String(cString: getpwuid(getuid()).pointee.pw_dir)
|
||||
#elseif os(iOS) || os(tvOS) || os(watchOS)
|
||||
#elseif canImport(Darwin)
|
||||
// getpwuid() returns null in sandboxed apps under iOS simulator.
|
||||
return NSHomeDirectory()
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user