From b89e4823ef9528936072f5f195d7fdab9e1f838b Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 25 Apr 2017 16:59:15 +0200 Subject: #ifdef out code which is a no-op with OpenSSL 1.1.0 CRYPTO_set_id_callback CRYPTO_set_locking_callback EVP_cleanup CRYPTO_cleanup_all_ex_data SSL_COMP_free_compression_methods are all no-ops with OpenSSL 1.1.0, so we can #ifdef out the corresponding code. This cleans up some warnings about id_function/locking_function being defined but unused (as the calls to CRYPTO_set_id_callback and CRYPTO_set_locking_callback disappear at preprocessing time). Signed-off-by: Christophe Fergeau --- src/idevice.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/idevice.c b/src/idevice.c index 1c43269..89724ff 100644 --- a/src/idevice.c +++ b/src/idevice.c @@ -69,6 +69,7 @@ static void openssl_remove_thread_state(void) #endif } +#if OPENSSL_VERSION_NUMBER < 0x10100000L static mutex_t *mutex_buf = NULL; static void locking_function(int mode, int n, const char* file, int line) { @@ -83,10 +84,12 @@ static unsigned long id_function(void) return ((unsigned long)THREAD_ID); } #endif +#endif static void internal_idevice_init(void) { #ifdef HAVE_OPENSSL +#if OPENSSL_VERSION_NUMBER < 0x10100000L int i; SSL_library_init(); @@ -98,6 +101,7 @@ static void internal_idevice_init(void) CRYPTO_set_id_callback(id_function); CRYPTO_set_locking_callback(locking_function); +#endif #else gnutls_global_init(); #endif @@ -106,6 +110,7 @@ static void internal_idevice_init(void) static void internal_idevice_deinit(void) { #ifdef HAVE_OPENSSL +#if OPENSSL_VERSION_NUMBER < 0x10100000L int i; if (mutex_buf) { CRYPTO_set_id_callback(NULL); @@ -120,6 +125,7 @@ static void internal_idevice_deinit(void) CRYPTO_cleanup_all_ex_data(); SSL_COMP_free_compression_methods(); openssl_remove_thread_state(); +#endif #else gnutls_global_deinit(); #endif -- cgit v1.1-32-gdbae