From 4b64428fe11db22f70c304de1bc9f0cc95f1d189 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 6 Aug 2013 04:24:14 +0200 Subject: [PATCH] Fix compile with current GnuTLS versions. --- src/tlsproxy.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tlsproxy.c b/src/tlsproxy.c index 0257d67..40729f0 100644 --- a/src/tlsproxy.c +++ b/src/tlsproxy.c @@ -32,9 +32,11 @@ #include #include +#if GNUTLS_VERSION_NUMBER <= 0x020b00 /* Necessary for GnuTLS when used with threads. */ #include GCRY_THREAD_OPTION_PTHREAD_IMPL; +#endif /* Size of ringbuffer. */ @@ -364,6 +366,9 @@ static void print_usage(const char *argv) { 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(). */ @@ -380,6 +385,7 @@ static void initialize_gnutls(void) { gcry_strerror(error)); exit(EXIT_FAILURE); } +#endif /* Initialize GnuTLS. */ result = gnutls_global_init(); -- 2.43.2