@@ -12,6 +12,8 @@ import protocol Foundation.CustomNSError
1212import var Foundation. NSLocalizedDescriptionKey
1313import TSCLibc
1414
15+ // FIXME: deprecate 2/2022, remove once clients transitioned
16+ @available ( * , deprecated, message: " moved to swift-driver " )
1517public final class DLHandle {
1618 #if os(Windows)
1719 typealias Handle = HMODULE
@@ -48,6 +50,8 @@ public final class DLHandle {
4850 }
4951}
5052
53+ // FIXME: deprecate 2/2022, remove once clients transitioned
54+ @available ( * , deprecated, message: " moved to swift-driver " )
5155public struct DLOpenFlags : RawRepresentable , OptionSet {
5256
5357 #if !os(Windows)
@@ -77,6 +81,8 @@ public struct DLOpenFlags: RawRepresentable, OptionSet {
7781 }
7882}
7983
84+ // FIXME: deprecate 2/2022, remove once clients transitioned
85+ @available ( * , deprecated, message: " moved to swift-driver " )
8086public enum DLError : Error {
8187 case `open`( String )
8288 case close( String )
@@ -88,6 +94,8 @@ extension DLError: CustomNSError {
8894 }
8995}
9096
97+ // FIXME: deprecate 2/2022, remove once clients transitioned
98+ @available ( * , deprecated, message: " moved to swift-driver " )
9199public func dlopen( _ path: String ? , mode: DLOpenFlags ) throws -> DLHandle {
92100 #if os(Windows)
93101 guard let handle = path? . withCString ( encodedAs: UTF16 . self, LoadLibraryW) else {
@@ -101,6 +109,8 @@ public func dlopen(_ path: String?, mode: DLOpenFlags) throws -> DLHandle {
101109 return DLHandle ( rawValue: handle)
102110}
103111
112+ // FIXME: deprecate 2/2022, remove once clients transitioned
113+ @available ( * , deprecated, message: " moved to swift-driver " )
104114public func dlsym< T> ( _ handle: DLHandle , symbol: String ) -> T ? {
105115 #if os(Windows)
106116 guard let ptr = GetProcAddress ( handle. rawValue!, symbol) else {
@@ -114,11 +124,15 @@ public func dlsym<T>(_ handle: DLHandle, symbol: String) -> T? {
114124 return unsafeBitCast ( ptr, to: T . self)
115125}
116126
127+ // FIXME: deprecate 2/2022, remove once clients transitioned
128+ @available ( * , deprecated, message: " moved to swift-driver " )
117129public func dlclose( _ handle: DLHandle ) throws {
118130 try handle. close ( )
119131}
120132
121133#if !os(Windows)
134+ // FIXME: deprecate 2/2022, remove once clients transitioned
135+ @available ( * , deprecated, message: " moved to swift-driver " )
122136public func dlerror( ) -> String ? {
123137 if let err: UnsafeMutablePointer < Int8 > = dlerror ( ) {
124138 return String ( cString: err)
0 commit comments