From bd6d249f268c586497da5db6a185fb81f7251164 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 19 Apr 2013 09:19:58 +0200 Subject: [PATCH] Define variables at the beginning of a block and do not call tunnel stuff is tunnel compilation is not enabled. --- coreapi/bellesip_sal/sal_impl.c | 9 ++++++++- coreapi/bellesip_sal/sal_sdp.c | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/coreapi/bellesip_sal/sal_impl.c b/coreapi/bellesip_sal/sal_impl.c index ab41a46b3..6ef7a2cdf 100644 --- a/coreapi/bellesip_sal/sal_impl.c +++ b/coreapi/bellesip_sal/sal_impl.c @@ -516,19 +516,26 @@ void sal_set_keepalive_period(Sal *ctx,unsigned int value){ return ; } int sal_enable_tunnel(Sal *ctx, void *tunnelclient) { +#ifdef TUNNEL_ENABLED + belle_sip_listening_point_t *lp; int result; sal_unlisten_ports(ctx); - belle_sip_listening_point_t* lp = belle_sip_tunnel_listening_point_new(ctx->stack, tunnelclient); + lp = belle_sip_tunnel_listening_point_new(ctx->stack, tunnelclient); if (lp == NULL) return -1; belle_sip_listening_point_set_keep_alive(lp, ctx->keep_alive); result = belle_sip_provider_add_listening_point(ctx->prov, lp); set_tls_properties(ctx); return result; +#else + return 0; +#endif } void sal_disable_tunnel(Sal *ctx) { +#ifdef TUNNEL_ENABLED sal_unlisten_ports(ctx); +#endif } /** * returns keepalive period in ms diff --git a/coreapi/bellesip_sal/sal_sdp.c b/coreapi/bellesip_sal/sal_sdp.c index 9efb449fb..1aa7f004c 100644 --- a/coreapi/bellesip_sal/sal_sdp.c +++ b/coreapi/bellesip_sal/sal_sdp.c @@ -431,8 +431,9 @@ int sdp_to_media_description ( belle_sdp_session_description_t *session_desc, S /* Get ICE candidate attributes if any */ for (attribute_it = belle_sdp_media_description_get_attributes(media_desc); attribute_it != NULL; attribute_it=attribute_it->next) { + const char *att_name; attribute=(belle_sdp_attribute_t*)attribute_it->data; - const char *att_name=belle_sdp_attribute_get_name(attribute); + att_name=belle_sdp_attribute_get_name(attribute); value=belle_sdp_attribute_get_value(attribute); if ((keywordcmp("candidate", att_name) == 0) && (value != NULL)) { SalIceCandidate *candidate = &stream->ice_candidates[nb_ice_candidates];