Skip to content

Commit fa4599d

Browse files
committed
gcrypt: Don't use thread callbacks for newer versions of libgcrypt
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.
1 parent 248f349 commit fa4599d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ struct private_gcrypt_plugin_t {
4343
gcrypt_plugin_t public;
4444
};
4545

46+
#if GCRYPT_VERSION_NUMBER < 0x010600
4647
/**
4748
* Define gcrypt multi-threading callbacks as gcry_threads_pthread
4849
*/
4950
GCRY_THREAD_OPTION_PTHREAD_IMPL;
51+
#endif
5052

5153
METHOD(plugin_t, get_name, char*,
5254
private_gcrypt_plugin_t *this)
@@ -163,7 +165,9 @@ plugin_t *gcrypt_plugin_create()
163165
{
164166
private_gcrypt_plugin_t *this;
165167

168+
#if GCRYPT_VERSION_NUMBER < 0x010600
166169
gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
170+
#endif
167171

168172
if (!gcry_check_version(GCRYPT_VERSION))
169173
{

0 commit comments

Comments
 (0)