[swift-evolution] Opaque Pointers in Swift

Cory Benfield cbenfield at apple.com
Tue Oct 24 12:32:18 CDT 2017



> On 24 Oct 2017, at 18:11, Félix Cloutier <felixcloutier at icloud.com> wrote:
> 
> Could you do a conditional typealias?

I don’t *think* so. In the case of OpenSSL the #define you want to use is OPENSSL_VERSION_NUMBER, which is defined in an OpenSSL header file. As far as I know, the Swift compiler does not see #defines from C header files when compiling Swift code (some experimenting suggests that this is still true, though I am not *certain* of that).

That would mean we’d have to pass this as a build flag with -D, which doesn’t really work with distribution via SwiftPM, and also would require that users know that this flag needs to be passed for newer OpenSSLs.

Cory



More information about the swift-evolution mailing list