EbrahimTahernejad / Tun2SocksKit

Tun2Socks framework repository
50 stars 32 forks source link

xcode add package and compile error #13

Open gif-gif opened 1 week ago

gif-gif commented 1 week ago
public static func run(withConfig config: Config) -> Int32 {
        guard let fileDescriptor = tunnelFileDescriptor else {
            return -1
        }
        switch config {
        case .file(let path):
            return hev_socks5_tunnel_main(path.path.cString(using: .utf8), fileDescriptor)
        case .string(let content):
            return hev_socks5_tunnel_main_from_str(content.cString(using: .utf8), UInt32(content.count), fileDescriptor)
        }
    }

error is:

Cannot convert value of type '[CChar]?' (aka 'Optional<Array<Int8>>') to expected argument type 'UnsafePointer<UInt8>?'