summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9c7c25a)
raw | patch | inline | side by side (parent: 9c7c25a)
author | Vincent Bernat <vincent@bernat.im> | |
Fri, 7 Nov 2014 14:20:22 +0000 (15:20 +0100) | ||
committer | Vincent Bernat <Vincent.Bernat@exoscale.ch> | |
Fri, 7 Nov 2014 14:46:48 +0000 (15:46 +0100) |
From `gcrypt.h`:
> NOTE: Since Libgcrypt 1.6 the thread callbacks are not anymore used.
> However we keep it to allow for some source code compatibility if used
> in the standard way.
Otherwise, we get a deprecation warning which is turned into an error:
```
CC libcollectdclient_la-network_buffer.lo
../../../src/libcollectdclient/network_buffer.c:58:15: error: 'gcry_thread_cbs' is deprecated (declared at /usr/include/gcrypt.h:213) [-Werror=deprecated-declarations]
GCRY_THREAD_OPTION_PTHREAD_IMPL;
```
Fixes: #632
> NOTE: Since Libgcrypt 1.6 the thread callbacks are not anymore used.
> However we keep it to allow for some source code compatibility if used
> in the standard way.
Otherwise, we get a deprecation warning which is turned into an error:
```
CC libcollectdclient_la-network_buffer.lo
../../../src/libcollectdclient/network_buffer.c:58:15: error: 'gcry_thread_cbs' is deprecated (declared at /usr/include/gcrypt.h:213) [-Werror=deprecated-declarations]
GCRY_THREAD_OPTION_PTHREAD_IMPL;
```
Fixes: #632
src/libcollectdclient/network_buffer.c | patch | blob | history | |
src/network.c | patch | blob | history |
index 7b06620479fafb6e369b0e05162a5963b9e44cc7..61c7c22e2d7ab963a2d98977f8c0c3747ad18723 100644 (file)
/* Re enable deprecation warnings */
# pragma GCC diagnostic warning "-Wdeprecated-declarations"
# endif
+# if GCRYPT_VERSION_NUMBER < 0x010600
GCRY_THREAD_OPTION_PTHREAD_IMPL;
+# endif
#endif
#include "collectd/network_buffer.h"
need_init = 0;
#if HAVE_LIBGCRYPT
+# if GCRYPT_VERSION_NUMBER < 0x010600
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+# endif
if (!gcry_check_version (GCRYPT_VERSION))
return (0);
diff --git a/src/network.c b/src/network.c
index bf0b2bc647e63f7de410e561dd2d9b16817fbd7c..bbdd6dd908946d3e7afbe9472e27f589841e0f10 100644 (file)
--- a/src/network.c
+++ b/src/network.c
/* Re enable deprecation warnings */
# pragma GCC diagnostic warning "-Wdeprecated-declarations"
# endif
+# if GCRYPT_VERSION_NUMBER < 0x010600
GCRY_THREAD_OPTION_PTHREAD_IMPL;
+# endif
#endif
#ifndef IPV6_ADD_MEMBERSHIP
* above doesn't count, as it doesn't implicitly initalize Libgcrypt.
*
* tl;dr: keep all these gry_* statements in this exact order please. */
+# if GCRYPT_VERSION_NUMBER < 0x010600
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+# endif
gcry_check_version (NULL);
gcry_control (GCRYCTL_INIT_SECMEM, 32768);
gcry_control (GCRYCTL_INITIALIZATION_FINISHED);