[sr-dev] git:master: registrar(s): fix compilation with old gccs
Andrei Pelinescu-Onciul
andrei at iptel.org
Tue Oct 5 19:44:25 CEST 2010
Module: sip-router
Branch: master
Commit: 2b5eff469996a1db5ac194ec3510b92acb78014d
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2b5eff469996a1db5ac194ec3510b92acb78014d
Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date: Tue Oct 5 18:46:14 2010 +0200
registrar(s): fix compilation with old gccs
Older gcc do no accept conditionals (#if) in macro arguments.
---
modules_s/registrar/save.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/modules_s/registrar/save.c b/modules_s/registrar/save.c
index f87fd3c..a491526 100644
--- a/modules_s/registrar/save.c
+++ b/modules_s/registrar/save.c
@@ -294,11 +294,14 @@ int parse_uri_dstip(str* received, struct ip_addr* ip, unsigned short* port,
hooks.uri.dstip->body.len == 0))
goto end; /* no dst_ip param */
/* check if it's ipv4 or ipv6 */
- if (likely(((p = str2ip(&hooks.uri.dstip->body)) != 0) ||
+ if (
#ifdef USE_IPV6
- ((p = str2ip6(&hooks.uri.dstip->body)) != 0)
+ likely(((p = str2ip(&hooks.uri.dstip->body)) != 0) ||
+ ((p = str2ip6(&hooks.uri.dstip->body)) != 0))
+#else /* ! USE_IPV6 */
+ likely(((p = str2ip(&hooks.uri.dstip->body)) != 0))
#endif /* USE_IPV6 */
- )) {
+ ) {
*ip = *p;
} else
goto error_no_ip; /* no ip */
More information about the sr-dev
mailing list