2
0
Эх сурвалжийг харах

registrar(s): fix compilation with old gccs

Older gcc do no accept conditionals (#if) in macro arguments.
Andrei Pelinescu-Onciul 15 жил өмнө
parent
commit
2b5eff4699

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