gcrypt: Don't use thread callbacks for newer versions of libgcrypt
authorTobias Brunner <tobias@strongswan.org>
Fri, 9 Nov 2018 15:04:54 +0000 (16:04 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 21 Nov 2018 13:36:38 +0000 (14:36 +0100)
According to gcrypt.h these callbacks are not used anymore since
version 1.6 and with clang these actually cause deprecation warnings
that let the build on travis (-Werror) fail.

src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c

index 45fba24..6946e45 100644 (file)
@@ -43,10 +43,12 @@ struct private_gcrypt_plugin_t {
        gcrypt_plugin_t public;
 };
 
        gcrypt_plugin_t public;
 };
 
+#if GCRYPT_VERSION_NUMBER < 0x010600
 /**
  * Define gcrypt multi-threading callbacks as gcry_threads_pthread
  */
 GCRY_THREAD_OPTION_PTHREAD_IMPL;
 /**
  * Define gcrypt multi-threading callbacks as gcry_threads_pthread
  */
 GCRY_THREAD_OPTION_PTHREAD_IMPL;
+#endif
 
 METHOD(plugin_t, get_name, char*,
        private_gcrypt_plugin_t *this)
 
 METHOD(plugin_t, get_name, char*,
        private_gcrypt_plugin_t *this)
@@ -163,7 +165,9 @@ plugin_t *gcrypt_plugin_create()
 {
        private_gcrypt_plugin_t *this;
 
 {
        private_gcrypt_plugin_t *this;
 
+#if GCRYPT_VERSION_NUMBER < 0x010600
        gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
        gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+#endif
 
        if (!gcry_check_version(GCRYPT_VERSION))
        {
 
        if (!gcry_check_version(GCRYPT_VERSION))
        {