Re: [swift-users] Casting function pointers

2017-01-25 Thread Rien via swift-users
Thank Joe, A first attempt was not successful, I will try again in a few days. For now I have put in a work around where I put glue-code into the openSSL library itself. I don’t like that solution, but it works. Regards, Rien Site: http://balancingrock.nl Blog: http://swiftrien.blogspot.com Gi

Re: [swift-users] Casting function pointers

2017-01-25 Thread Joe Groff via swift-users
> On Jan 25, 2017, at 1:23 AM, Rien via swift-users > wrote: > > I have a case where a callback has the following signature: > > @convention(c) (_ ssl: OpaquePointer?, _ num: UnsafeMutablePointer?, _ > arg: UnsafeMutableRawPointer?) -> Int32 > > But to install this callback I have to use a c

Re: [swift-users] Casting function pointers

2017-01-25 Thread Rien via swift-users
I should clarify: is it possible to cast: > @convention(c) (_ ssl: OpaquePointer?, _ num: UnsafeMutablePointer?, _ > arg: UnsafeMutableRawPointer?) -> Int32 to: > (() -> Void)! ??? Regards, Rien Site: http://balancingrock.nl Blog: http://swiftrien.blogspot.com Github: http://github.com/Bala

[swift-users] Casting function pointers

2017-01-25 Thread Rien via swift-users
I have a case where a callback has the following signature: @convention(c) (_ ssl: OpaquePointer?, _ num: UnsafeMutablePointer?, _ arg: UnsafeMutableRawPointer?) -> Int32 But to install this callback I have to use a c-function with this signature: SSL_CTX_callback_ctrl (OpaquePointer!, Int32, (