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.
This commit is contained in:
chrysn 2013-05-27 07:15:51 +02:00 committed by sg
parent 8155b8cfb3
commit 81d4e201bb

View File

@ -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,