mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-25 01:27:05 +08:00
opt.h, mem.h, mem.c, memp.c, pbuf.c, ip_frag.c, vj.c: Fix bug #20162. Rename MEM_ALIGN in LWIP_MEM_ALIGN and MEM_ALIGN_SIZE in LWIP_MEM_ALIGN_SIZE to avoid some macro names collision with some OS macros.
This commit is contained in:
@@ -67,18 +67,18 @@ typedef u16_t mem_size_t;
|
||||
#endif
|
||||
#else /* MEM_LIBC_MALLOC */
|
||||
/* lwIP alternative malloc */
|
||||
void mem_init(void);
|
||||
void mem_init(void);
|
||||
void *mem_malloc(mem_size_t size);
|
||||
void mem_free(void *mem);
|
||||
void mem_free(void *mem);
|
||||
void *mem_realloc(void *mem, mem_size_t size);
|
||||
#endif /* MEM_LIBC_MALLOC */
|
||||
|
||||
#ifndef MEM_ALIGN_SIZE
|
||||
#define MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1) & ~(MEM_ALIGNMENT-1))
|
||||
#ifndef LWIP_MEM_ALIGN_SIZE
|
||||
#define LWIP_MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1) & ~(MEM_ALIGNMENT-1))
|
||||
#endif
|
||||
|
||||
#ifndef MEM_ALIGN
|
||||
#define MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & ~(mem_ptr_t)(MEM_ALIGNMENT-1)))
|
||||
#ifndef LWIP_MEM_ALIGN
|
||||
#define LWIP_MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & ~(mem_ptr_t)(MEM_ALIGNMENT-1)))
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -426,7 +426,7 @@ a lot of data that needs to be copied, this should be set high. */
|
||||
#ifndef PBUF_POOL_BUFSIZE
|
||||
/* Default designed to accomodate single full size TCP frame in one PBUF */
|
||||
/* TCP_MSS + 40 for IP and TCP headers + physical layer headers */
|
||||
#define PBUF_POOL_BUFSIZE MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN)
|
||||
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user