Pārlūkot izejas kodu

registrar(s): fix compilation with old gccs

Older gcc do no accept conditionals (#if) in macro arguments.
Andrei Pelinescu-Onciul 15 gadi atpakaļ
vecāks
revīzija
2b5eff4699
1 mainītis faili ar 6 papildinājumiem un 3 dzēšanām
  1. 6 3
      modules_s/registrar/save.c

+ 6 - 3
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 */