From 81d4e201bb6e5549047d4aa261f754125b97b0e7 Mon Sep 17 00:00:00 2001 From: chrysn Date: Mon, 27 May 2013 07:15:51 +0200 Subject: [PATCH] include the memp struct list once before actually using it when custom lwipopts.h files are used (MEMP_USE_CUSTOM_POOLS), there is typically the need to use sizeof(some_struct) in there, but on structs that are not already declared in lwip; thus, they use #include on custom headers. even if the included files have proper include guards, the way memp headers are used ( typedef enum { #define LWIP_MEMPOOL(name,num,size,desc) MEMP_##name, #include "lwip/memp_std.h" MEMP_MAX } memp_t; ) breaks when fresh includes are involved. in this patch, this gets circumvented by including lwip/memp_std.h once with an empty LWIP_MEMPOOL definition, so that all the includes from custom lwippools.h files can be handled safely. --- src/include/lwip/memp.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/include/lwip/memp.h b/src/include/lwip/memp.h index 405c1094..501f9a31 100644 --- a/src/include/lwip/memp.h +++ b/src/include/lwip/memp.h @@ -39,6 +39,10 @@ extern "C" { #endif +/* run once with empty definition to handle all custom includes in lwippools.h */ +#define LWIP_MEMPOOL(name,num,size,desc) +#include "lwip/memp_std.h" + /* Create the list of all memory pools managed by memp. MEMP_MAX represents a NULL pool at the end */ typedef enum { #define LWIP_MEMPOOL(name,num,size,desc) MEMP_##name,