[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] "HIDE the declaration of PBUF STRUCT in pbuf.h"
From: |
antonio |
Subject: |
[lwip-users] "HIDE the declaration of PBUF STRUCT in pbuf.h" |
Date: |
Wed, 1 Nov 2017 05:58:50 -0700 (MST) |
Hi all,
I *moved* the declaration of *struct pbuf from pbuf.h to pbuf.c*. In
addition, I also *created functions for accessing and setting pbuf struct
fields*. Then I went in all the files and *replaced direct access to my
provided functions using "Coccinelle" *. However, I have many compilation
errors.
The main issue is related to memp.c/h which uses some strange compile magics
that I don't understand :(
Could you please give me some pointers in solving these compilation errors ?
here is my error log.
(arm-cc-m3) core/memp.c
(arm-cc-m3) core/raw.c
(arm-cc-m3) core/stats.c
(arm-cc-m3) core/main.c
In file included from core/memp.c:61:0:
.*./lwip2/include/lwip/ip4_frag.h:87:22: error: field 'pc' has incomplete
type
struct pbuf_custom pc;*
^
In file included from ../lwip2/include/lwip/debug.h:40:0,
from ../lwip2/include/lwip/opt.h:52,
from core/memp.c:46:
..*/lwip2/include/lwip/priv/memp_std.h:32:101: error: invalid application of
'sizeof' to incomplete type 'struct pbuf'*
#define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num,
(MEMP_ALIGN_SIZE(sizeof(struct pbuf)) + MEMP_ALIGN_SIZE(payload)), desc)
^
../lwip2/include/lwip/arch.h:124:38: note: in definition of macro
'LWIP_MEM_ALIGN_SIZE'
#define LWIP_MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1U) &
~(MEM_ALIGNMENT-1U))
^
core/memp.c:80:42: note: in expansion of macro 'LWIP_MEMPOOL_DECLARE'
#define LWIP_MEMPOOL(name,num,size,desc)
LWIP_MEMPOOL_DECLARE(name,num,size,desc)
^
../lwip2/include/lwip/priv/memp_std.h:32:53: note: in expansion of macro
'LWIP_MEMPOOL'
#define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num,
(MEMP_ALIGN_SIZE(sizeof(struct pbuf)) + MEMP_ALIGN_SIZE(payload)), desc)
^
../lwip2/include/lwip/priv/memp_priv.h:86:29: note: in expansion of macro
'LWIP_MEM_ALIGN_SIZE'
#define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x))
^
../lwip2/include/lwip/priv/memp_std.h:32:78: note: in expansion of macro
'MEMP_ALIGN_SIZE'
#define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num,
(MEMP_ALIGN_SIZE(sizeof(struct pbuf)) + MEMP_ALIGN_SIZE(payload)), desc)
^
../lwip2/include/lwip/priv/memp_std.h:137:1: note: in expansion of macro
'LWIP_PBUF_MEMPOOL'
LWIP_PBUF_MEMPOOL(PBUF, MEMP_NUM_PBUF, 0,
"PBUF_REF/ROM")
^
../lwip2/include/lwip/priv/memp_std.h:32:101: error: invalid application of
'sizeof' to incomplete type 'struct pbuf'
#define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num,
(MEMP_ALIGN_SIZE(sizeof(struct pbuf)) + MEMP_ALIGN_SIZE(payload)), desc)
^
../lwip2/include/lwip/arch.h:124:38: note: in definition of macro
'LWIP_MEM_ALIGN_SIZE'
#define LWIP_MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1U) &
~(MEM_ALIGNMENT-1U))
^
core/memp.c:80:42: note: in expansion of macro 'LWIP_MEMPOOL_DECLARE'
#define LWIP_MEMPOOL(name,num,size,desc)
LWIP_MEMPOOL_DECLARE(name,num,size,desc)
^
../lwip2/include/lwip/priv/memp_std.h:32:53: note: in expansion of macro
'LWIP_MEMPOOL'
#define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num,
(MEMP_ALIGN_SIZE(sizeof(struct pbuf)) + MEMP_ALIGN_SIZE(payload)), desc)
^
../lwip2/include/lwip/priv/memp_priv.h:86:29: note: in expansion of macro
'LWIP_MEM_ALIGN_SIZE'
#define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x))
^
../lwip2/include/lwip/priv/memp_std.h:32:78: note: in expansion of macro
'MEMP_ALIGN_SIZE'
#define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num,
(MEMP_ALIGN_SIZE(sizeof(struct pbuf)) + MEMP_ALIGN_SIZE(payload)), desc)
^
../lwip2/include/lwip/priv/memp_std.h:138:1: note: in expansion of macro
'LWIP_PBUF_MEMPOOL'
LWIP_PBUF_MEMPOOL(PBUF_POOL, PBUF_POOL_SIZE, PBUF_POOL_BUFSIZE,
"PBUF_POOL")
^
../build/rules.mak:85: recipe for target '.objs-arm/core/memp.o' failed
make: *** [.objs-arm/core/memp.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from core/main.c:21:0:
../lwip2/include/lwip/ip4_frag.h:87:22: error: field 'pc' has incomplete
type
struct pbuf_custom pc;
^
../build/rules.mak:85: recipe for target '.objs-arm/core/main.o' failed
make: *** [.objs-arm/core/main.o] Error 1
make: *** wait: No child processes. Stop.
--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
- [lwip-users] "HIDE the declaration of PBUF STRUCT in pbuf.h",
antonio <=