@@ -12,6 +12,8 @@ import protocol Foundation.CustomNSError
12
12
import var Foundation. NSLocalizedDescriptionKey
13
13
import TSCLibc
14
14
15
+ // FIXME: deprecate 2/2022, remove once clients transitioned
16
+ @available ( * , deprecated, message: " moved to swift-driver " )
15
17
public final class DLHandle {
16
18
#if os(Windows)
17
19
typealias Handle = HMODULE
@@ -48,6 +50,8 @@ public final class DLHandle {
48
50
}
49
51
}
50
52
53
+ // FIXME: deprecate 2/2022, remove once clients transitioned
54
+ @available ( * , deprecated, message: " moved to swift-driver " )
51
55
public struct DLOpenFlags : RawRepresentable , OptionSet {
52
56
53
57
#if !os(Windows)
@@ -77,6 +81,8 @@ public struct DLOpenFlags: RawRepresentable, OptionSet {
77
81
}
78
82
}
79
83
84
+ // FIXME: deprecate 2/2022, remove once clients transitioned
85
+ @available ( * , deprecated, message: " moved to swift-driver " )
80
86
public enum DLError : Error {
81
87
case `open`( String )
82
88
case close( String )
@@ -88,6 +94,8 @@ extension DLError: CustomNSError {
88
94
}
89
95
}
90
96
97
+ // FIXME: deprecate 2/2022, remove once clients transitioned
98
+ @available ( * , deprecated, message: " moved to swift-driver " )
91
99
public func dlopen( _ path: String ? , mode: DLOpenFlags ) throws -> DLHandle {
92
100
#if os(Windows)
93
101
guard let handle = path? . withCString ( encodedAs: UTF16 . self, LoadLibraryW) else {
@@ -101,6 +109,8 @@ public func dlopen(_ path: String?, mode: DLOpenFlags) throws -> DLHandle {
101
109
return DLHandle ( rawValue: handle)
102
110
}
103
111
112
+ // FIXME: deprecate 2/2022, remove once clients transitioned
113
+ @available ( * , deprecated, message: " moved to swift-driver " )
104
114
public func dlsym< T> ( _ handle: DLHandle , symbol: String ) -> T ? {
105
115
#if os(Windows)
106
116
guard let ptr = GetProcAddress ( handle. rawValue!, symbol) else {
@@ -114,11 +124,15 @@ public func dlsym<T>(_ handle: DLHandle, symbol: String) -> T? {
114
124
return unsafeBitCast ( ptr, to: T . self)
115
125
}
116
126
127
+ // FIXME: deprecate 2/2022, remove once clients transitioned
128
+ @available ( * , deprecated, message: " moved to swift-driver " )
117
129
public func dlclose( _ handle: DLHandle ) throws {
118
130
try handle. close ( )
119
131
}
120
132
121
133
#if !os(Windows)
134
+ // FIXME: deprecate 2/2022, remove once clients transitioned
135
+ @available ( * , deprecated, message: " moved to swift-driver " )
122
136
public func dlerror( ) -> String ? {
123
137
if let err: UnsafeMutablePointer < Int8 > = dlerror ( ) {
124
138
return String ( cString: err)
0 commit comments