ip.h, etharp.c: Fix warnings & errors about LWIP_NETIF_HWADDRHINT (perhaps compiler dependant)

This commit is contained in:
fbernon 2007-07-03 10:36:21 +00:00
parent fdc0d30337
commit 3a0ab861c2
3 changed files with 29 additions and 23 deletions

View File

@ -69,6 +69,11 @@ err_t ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
#endif /* IP_HDRINCL */ #endif /* IP_HDRINCL */
#define IP_HDRINCL NULL #define IP_HDRINCL NULL
#if LWIP_NETIF_HWADDRHINT
#define IP_PCB_ADDRHINT ;u8_t addr_hint
#else
#define IP_PCB_ADDRHINT
#endif /* LWIP_NETIF_HWADDRHINT */
/* This is the common part of all PCB types. It needs to be at the /* This is the common part of all PCB types. It needs to be at the
beginning of a PCB type definition. It is located here so that beginning of a PCB type definition. It is located here so that
@ -83,11 +88,9 @@ err_t ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
/* Type Of Service */ \ /* Type Of Service */ \
u8_t tos; \ u8_t tos; \
/* Time To Live */ \ /* Time To Live */ \
u8_t ttl; \ u8_t ttl \
#if LWIP_NETIF_HWADDRHINT
/* link layer address resolution hint */ \ /* link layer address resolution hint */ \
u8_t addr_hint IP_PCB_ADDRHINT
#endif /* LWIP_NETIF_HWADDRHINT */
/* /*
@ -105,7 +108,6 @@ err_t ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
#define SOF_REUSEPORT (u16_t)0x0200U /* allow local address & port reuse */ #define SOF_REUSEPORT (u16_t)0x0200U /* allow local address & port reuse */
#ifdef PACK_STRUCT_USE_INCLUDES #ifdef PACK_STRUCT_USE_INCLUDES
# include "arch/bpstruct.h" # include "arch/bpstruct.h"
#endif #endif

View File

@ -58,6 +58,12 @@ extern "C" {
#endif /* IP_HDRINCL */ #endif /* IP_HDRINCL */
#define IP_HDRINCL NULL #define IP_HDRINCL NULL
#if LWIP_NETIF_HWADDRHINT
#define IP_PCB_ADDRHINT ;u8_t addr_hint
#else
#define IP_PCB_ADDRHINT
#endif /* LWIP_NETIF_HWADDRHINT */
/* This is the common part of all PCB types. It needs to be at the /* This is the common part of all PCB types. It needs to be at the
beginning of a PCB type definition. It is located here so that beginning of a PCB type definition. It is located here so that
changes to this common part are made in one location instead of changes to this common part are made in one location instead of
@ -70,10 +76,8 @@ extern "C" {
u8_t tos; \ u8_t tos; \
/* Time To Live */ \ /* Time To Live */ \
u8_t ttl; \ u8_t ttl; \
#if LWIP_NETIF_HWADDRHINT
/* link layer address resolution hint */ \ /* link layer address resolution hint */ \
u8_t addr_hint IP_PCB_ADDRHINT
#endif /* LWIP_NETIF_HWADDRHINT */
/* The IPv6 header. */ /* The IPv6 header. */

View File

@ -116,8 +116,8 @@ static u8_t etharp_cached_entry = 0;
#define ETHARP_FIND_ONLY 2 #define ETHARP_FIND_ONLY 2
#if LWIP_NETIF_HWADDRHINT #if LWIP_NETIF_HWADDRHINT
#define NETIF_SET_HINT(netif, hint) (((netif) != NULL) && ((netif)->addr_hint != NULL)) ? \ #define NETIF_SET_HINT(netif, hint) if (((netif) != NULL) && ((netif)->addr_hint != NULL)) \
*((netif)->addr_hint) = (hint) : LWIP_UNUSED_ARG(hint) ; *((netif)->addr_hint) = (hint);
static s8_t find_entry(struct ip_addr *ipaddr, u8_t flags, struct netif *netif); static s8_t find_entry(struct ip_addr *ipaddr, u8_t flags, struct netif *netif);
#else /* LWIP_NETIF_HWADDRHINT */ #else /* LWIP_NETIF_HWADDRHINT */
static s8_t find_entry(struct ip_addr *ipaddr, u8_t flags); static s8_t find_entry(struct ip_addr *ipaddr, u8_t flags);