File tree Expand file tree Collapse file tree 3 files changed +4
-18
lines changed
tools/swiftdt/Sources/swiftdt Expand file tree Collapse file tree 3 files changed +4
-18
lines changed Original file line number Diff line number Diff line change 1
- import Darwin
1
+ import Foundation
2
2
import SwiftRemoteMirror
3
3
import SymbolicationShims
4
4
Original file line number Diff line number Diff line change 1
- import Darwin
1
+ import Foundation
2
2
3
3
enum Std {
4
4
struct File : TextOutputStream {
Original file line number Diff line number Diff line change 1
- import Darwin
1
+ import Foundation
2
2
import SymbolicationShims
3
3
4
4
private let symbolicationPath =
@@ -51,25 +51,11 @@ enum Sym {
51
51
symbol ( symbolicationHandle, " task_stop_peeking " )
52
52
}
53
53
54
- private enum CF {
55
- static let path = " /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation "
56
- static let handle = dlopen ( path, RTLD_LAZY) !
57
- static let stringCreateWithCString :
58
- @convention ( c) ( UnsafeRawPointer ? , UnsafePointer < CChar > , UInt32 ) ->
59
- Unmanaged < AnyObject > = symbol ( handle, " CFStringCreateWithCString " )
60
- static let stringEncodingUTF8 : UInt32 = 0x08000100
61
- }
62
-
63
54
typealias CSMachineTime = UInt64
64
55
let kCSNow = CSMachineTime ( Int64 . max) + 1
65
56
66
- private func withNSString< T> ( _ str: String , call: ( AnyObject ) -> T ) -> T {
67
- let cfstr = CF . stringCreateWithCString ( nil , str, CF . stringEncodingUTF8)
68
- return call ( cfstr. takeRetainedValue ( ) )
69
- }
70
-
71
57
func pidFromHint( _ hint: String ) -> pid_t ? {
72
- let result = withNSString ( hint, call : Sym . pidFromHint )
58
+ let result = Sym . pidFromHint ( hint as NSString )
73
59
return result == 0 ? nil : result
74
60
}
75
61
You can’t perform that action at this time.
0 commit comments