diff --git a/src/core/stats.c b/src/core/stats.c index 6685c86a..3b3f4871 100644 --- a/src/core/stats.c +++ b/src/core/stats.c @@ -39,15 +39,13 @@ #include "lwip/mem.h" -#ifdef STATS +#if LWIP_STATS struct stats_ lwip_stats; -#endif /* STATS */ /*-----------------------------------------------------------------------------------*/ void stats_init(void) { -#ifdef STATS memset(&lwip_stats, 0, sizeof(struct stats_)); -#endif /* STATS */ } +#endif /* LWIP_STATS */ /*-----------------------------------------------------------------------------------*/ diff --git a/src/include/lwip/dhcp.h b/src/include/lwip/dhcp.h index 38239cb7..79f1cae2 100644 --- a/src/include/lwip/dhcp.h +++ b/src/include/lwip/dhcp.h @@ -87,9 +87,6 @@ PACK_STRUCT_END # include "arch/epstruct.h" #endif -/* Declare here to avoid including netif.h creating a circular dependency */ -//struct netif; - /** start DHCP configuration */ err_t dhcp_start(struct netif *netif); /** stop DHCP configuration */ diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index 391e6b6e..347d1a46 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -297,9 +297,12 @@ a lot of data that needs to be copied, this should be set high. */ #endif /* ---------- Statistics options ---------- */ -#define STATS +#ifndef LWIP_STATS +#define LWIP_STATS 1 +#endif + +#if LWIP_STATS -#ifdef STATS #define LINK_STATS #define IP_STATS #define ICMP_STATS @@ -309,7 +312,8 @@ a lot of data that needs to be copied, this should be set high. */ #define MEMP_STATS #define PBUF_STATS #define SYS_STATS -#endif /* STATS */ + +#endif /* LWIP_STATS */ /* Debugging options all default to off */ diff --git a/src/include/lwip/stats.h b/src/include/lwip/stats.h index 5e014da3..3ccc3e75 100644 --- a/src/include/lwip/stats.h +++ b/src/include/lwip/stats.h @@ -38,7 +38,7 @@ #include "lwip/mem.h" #include "lwip/memp.h" -#ifdef STATS +#if LWIP_STATS struct stats_proto { u16_t xmit; /* Transmitted packets. */ @@ -99,9 +99,11 @@ struct stats_ { extern struct stats_ lwip_stats; -#endif /* STATS */ void stats_init(void); +#else +#define stats_init() +#endif /* LWIP_STATS */ #endif /* __LWIP_STATS_H__ */