From 1dcd5d31d7bbb9390b2ee45f32b3f7706bb39746 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Sun, 8 May 2016 03:09:51 +0200 Subject: [PATCH] pbuf: fix undefined PBUF_POOL_FREE_OOSEQ if TCP_QUEUE_OOSEQ is disabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lwip/src/core/timers.c: In function ‘sys_check_timeouts’: lwip/src/core/timers.c:328:5: error: "PBUF_POOL_FREE_OOSEQ" is not defined [-Werror=undef] #if PBUF_POOL_FREE_OOSEQ Fix it by declaring an empty PBUF_CHECK_FREE_OOSEQ() function if feature is not enabled. --- src/core/timers.c | 2 -- src/include/lwip/pbuf.h | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/core/timers.c b/src/core/timers.c index 6b257441..9c4bb7f8 100644 --- a/src/core/timers.c +++ b/src/core/timers.c @@ -325,9 +325,7 @@ sys_check_timeouts(void) /* this cares for wraparounds */ diff = now - timeouts_last_time; do { -#if PBUF_POOL_FREE_OOSEQ PBUF_CHECK_FREE_OOSEQ(); -#endif /* PBUF_POOL_FREE_OOSEQ */ had_one = 0; tmptimeout = next_timeout; if (tmptimeout && (tmptimeout->time <= diff)) { diff --git a/src/include/lwip/pbuf.h b/src/include/lwip/pbuf.h index 08dd8c77..fa0857dc 100644 --- a/src/include/lwip/pbuf.h +++ b/src/include/lwip/pbuf.h @@ -164,12 +164,11 @@ struct pbuf_custom { }; #endif /* LWIP_SUPPORT_CUSTOM_PBUF */ -#if LWIP_TCP && TCP_QUEUE_OOSEQ /** Define this to 0 to prevent freeing ooseq pbufs when the PBUF_POOL is empty */ #ifndef PBUF_POOL_FREE_OOSEQ #define PBUF_POOL_FREE_OOSEQ 1 #endif /* PBUF_POOL_FREE_OOSEQ */ -#if NO_SYS && PBUF_POOL_FREE_OOSEQ +#if LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ extern volatile u8_t pbuf_free_ooseq_pending; void pbuf_free_ooseq(void); /** When not using sys_check_timeouts(), call PBUF_CHECK_FREE_OOSEQ() @@ -179,8 +178,10 @@ void pbuf_free_ooseq(void); /* pbuf_alloc() reported PBUF_POOL to be empty -> try to free some \ ooseq queued pbufs now */ \ pbuf_free_ooseq(); }}while(0) -#endif /* NO_SYS && PBUF_POOL_FREE_OOSEQ*/ -#endif /* LWIP_TCP && TCP_QUEUE_OOSEQ */ +#else /* LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ */ + /* Otherwise declare an empty PBUF_CHECK_FREE_OOSEQ */ + #define PBUF_CHECK_FREE_OOSEQ() +#endif /* LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ*/ /* Initializes the pbuf module. This call is empty for now, but may not be in future. */ #define pbuf_init()