#include <sys/types.h>
#include <unistd.h>
+#if GNUTLS_VERSION_NUMBER <= 0x020b00
/* Necessary for GnuTLS when used with threads. */
#include <gcrypt.h>
GCRY_THREAD_OPTION_PTHREAD_IMPL;
+#endif
/* Size of ringbuffer. */
static void initialize_gnutls(void) {
int result;
+/* Recent versions of GnuTLS automatically initialize the cryptography layer
+ * in gnutls_global_init(). */
+#if GNUTLS_VERSION_NUMBER <= 0x020b00
gcry_error_t error;
/* Thread safe setup. Must be called before gnutls_global_init(). */
gcry_strerror(error));
exit(EXIT_FAILURE);
}
+#endif
/* Initialize GnuTLS. */
result = gnutls_global_init();