From 379e65800c136b33511eb7ce0017f7a577b3167b Mon Sep 17 00:00:00 2001 From: Kyle Levin Date: Wed, 15 Mar 2017 18:08:36 -0400 Subject: [PATCH] openssl >= 1.0.1 has SSL_OP_NO_SSLv2 == 0; fix unused-function warning for pointed-to-only functions --- src/SSLSocket.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/SSLSocket.m b/src/SSLSocket.m index b16a9d5..60f8a54 100644 --- a/src/SSLSocket.m +++ b/src/SSLSocket.m @@ -70,6 +70,10 @@ static SSL_CTX *ctx; static of_mutex_t *ssl_mutexes; +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunused-function" +#endif static unsigned long get_thread_id(void) { @@ -89,6 +93,9 @@ locking_callback(int mode, int n, const char *file, int line) else of_mutex_unlock(&ssl_mutexes[n]); } +#if defined(__clang__) +# pragma clang diagnostic pop +#endif @implementation SSLSocket @synthesize delegate = _delegate, certificateFile = _certificateFile; @@ -126,7 +133,7 @@ locking_callback(int mode, int n, const char *file, int line) @throw [OFInitializationFailedException exceptionWithClass: self]; - if ((SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2) == 0) + if ((SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2) != SSL_OP_NO_SSLv2) @throw [OFInitializationFailedException exceptionWithClass: self];