lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Compilation error encountered when using memory pool (M


From: address@hidden
Subject: Re: [lwip-users] Compilation error encountered when using memory pool (MEM USE POOLS=1)
Date: Wed, 1 Jul 2020 14:21:56 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

Am 01.07.2020 um 12:34 schrieb yanhc519 via lwip-users:
> 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_POOLS1
> #define MEMP_USE_CUSTOM_POOLS1
> Also, I add a lwippool.h file to my project and define the following:

You probably mean "lwippools.h" (note the s)?

> #ifndef __LWIPPOOLS_H__
> #define __LWIPPOOLS_H__

This file is special in that it is included multiple times with the
defines set to work differently each time. So you need to leave out the
include guard.

Regards,
Simon

>
> 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
>
> _______________________________________________
> lwip-users mailing list
> lwip-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>




reply via email to

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