From ad2bca6903af3d02737b893679396343cd598a3e Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Wed, 22 May 2013 19:22:26 -0400 Subject: [PATCH 200/246] ui/vnc-tls.c: fix gnutls warning --- ui/vnc-tls.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ui/vnc-tls.c b/ui/vnc-tls.c index 5629263..2d01982 100644 --- a/ui/vnc-tls.c +++ b/ui/vnc-tls.c @@ -99,9 +99,13 @@ static ssize_t vnc_tls_pull(gnutls_transport_ptr_t transport, } -static gnutls_anon_server_credentials vnc_tls_initialize_anon_cred(void) +static gnutls_anon_server_credentials_t vnc_tls_initialize_anon_cred(void) { +#if GNUTLS_VERSION_MAJOR < 3 gnutls_anon_server_credentials anon_cred; +#else + gnutls_anon_server_credentials_t anon_cred; +#endif int ret; if ((ret = gnutls_anon_allocate_server_credentials(&anon_cred)) < 0) { @@ -382,7 +386,12 @@ int vnc_tls_client_setup(struct VncState *vs, } } else { - gnutls_anon_server_credentials anon_cred = vnc_tls_initialize_anon_cred(); +#if GNUTLS_VERSION_MAJOR < 2 + gnutls_anon_server_credentials +#else + gnutls_anon_server_credentials_t +#endif + anon_cred = vnc_tls_initialize_anon_cred(); if (!anon_cred) { gnutls_deinit(vs->tls.session); vs->tls.session = NULL; -- 1.8.2.1