ip_addr: Define ip_addr_cmp_zoneless for LWIP_IPV6 only

This fixes build error when LWIP_IPV4=0 && LWIP_IPV6=1:
cc -g -Wall -DLWIP_DEBUG -pedantic -Werror -Wparentheses -Wsequence-point -Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wunreachable-code -Wuninitialized -Wlogical-op -I. -I../../.. -I../../../../lwip/src/include -I../../../ports/unix/port/include -I../../../../mbedtls/include -Wno-redundant-decls -DLWIP_HAVE_MBEDTLS=1 -c ../../../../lwip/src/apps/mdns/mdns.c
../../../../lwip/src/apps/mdns/mdns.c: In function ‘mdns_recv’:
../../../../lwip/src/apps/mdns/mdns.c:1817:10: error: implicit declaration of function ‘ip_addr_cmp_zoneless’; did you mean ‘ip6_addr_cmp_zoneless’? [-Werror=implicit-function-declaration]
     if (!ip_addr_cmp_zoneless(ip_current_dest_addr(), &v6group)) {
          ^~~~~~~~~~~~~~~~~~~~
          ip6_addr_cmp_zoneless
../../../../lwip/src/apps/mdns/mdns.c:1817:10: error: nested extern declaration of ‘ip_addr_cmp_zoneless’ [-Werror=nested-externs]
cc1: all warnings being treated as errors

Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
Axel Lin 2018-01-09 16:41:48 +08:00 committed by Erik Ekman
parent 2d06483d8e
commit 39ada6ec0e

View File

@ -340,6 +340,7 @@ typedef ip6_addr_t ip_addr_t;
#define ip_addr_get_network(target, host, mask) ip6_addr_set_zero(target)
#define ip_addr_netcmp(addr1, addr2, mask) 0
#define ip_addr_cmp(addr1, addr2) ip6_addr_cmp(addr1, addr2)
#define ip_addr_cmp_zoneless(addr1, addr2) ip6_addr_cmp_zoneless(addr1, addr2)
#define ip_addr_isany(ipaddr) ip6_addr_isany(ipaddr)
#define ip_addr_isany_val(ipaddr) ip6_addr_isany_val(ipaddr)
#define ip_addr_isloopback(ipaddr) ip6_addr_isloopback(ipaddr)