lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Compilation error encountered when using memory pool (MEM U


From: yanhc519
Subject: [lwip-users] Compilation error encountered when using memory pool (MEM USE POOLS=1)
Date: Wed, 1 Jul 2020 18:34:17 +0800

Hi all,

I want to use the memory pool in lwip. I define the following macros to 1 to enable memory pool.
#define MEM_USE_POOLS 1
#define MEMP_USE_CUSTOM_POOLS 1
Also, I add a lwippool.h file to my project and define the following:
#ifndef __LWIPPOOLS_H__
#define __LWIPPOOLS_H__

LWIP_MALLOC_MEMPOOL_START
LWIP_MALLOC_MEMPOOL(20, 256)
LWIP_MALLOC_MEMPOOL_END

#endif /* __LWIPPOOLS_H__ */

However, when I compiled the project in MDK, an error encountered as following:
..\..\..\..\Utilities\Third_Party\lwip-2.1.0\src\include\lwip/priv/memp_priv.h(89): error:  #29: expected an _expression_.

memp_priv.h(89) is as following:
typedef enum {
    /* Get the first (via:
       MEMP_POOL_HELPER_START = ((u8_t) 1*MEMP_POOL_A + 0*MEMP_POOL_B + 0*MEMP_POOL_C + 0)*/
    MEMP_POOL_HELPER_FIRST = ((u8_t)
#define LWIP_MEMPOOL(name,num,size,desc)
#define LWIP_MALLOC_MEMPOOL_START 1
#define LWIP_MALLOC_MEMPOOL(num, size) * MEMP_POOL_##size + 0
#define LWIP_MALLOC_MEMPOOL_END
#include "lwip/priv/memp_std.h"
    ) ,

After preprocessing, the enumeration will be look like as this:
typedef enum {
    MEMP_POOL_HELPER_FIRST = ((u8_t)
1
 * MEMP_POOL_256 + 0
    ) ,

Since there is no definition of MEMP_POOL_256, so the compiler reports an error. 

Am I right? Is there anything I missing? How can I solve the issue?

Thanks,

York

reply via email to

[Prev in Thread] Current Thread [Next in Thread]