lwip-devel
[Top][All Lists]
Advanced

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

RE: [lwip-devel] Cleaner include handling / using pbuf standalone


From: Bill Auerbach
Subject: RE: [lwip-devel] Cleaner include handling / using pbuf standalone
Date: Tue, 9 Feb 2010 09:01:01 -0500

>Besides from the core/port issue there is the ipv4/v6 issue. This can
>currently only be solved by giving he headers different names (i.e.
>adding v4 or v6 to the names somewhere). Then there's the include/netif
>directory. This one could indeed be removed, I guess, since it only
>contains 3 files or so (note that the api headers are in the core
>include directory, too, so why not the netif headers).

This is it.  Because some #includes are prefixed with lwip/ or arch/, it 
requires search paths to the parent of lwip and arch if you're not in the 
current lwip folder (which I was not building a driver requiring pbuf.h).  
Simon hit the nail too in that ipv4 is needed.  Since macros can be used in 
#includes, why not #define IPCORE_FOLDER to either ipv4 or ipv6 and use 
#include IPCORE_FOLDER ## /lwip/ip.h (or something like this that actually 
works).

>That won't work currently, as cc.h and sys_arch.h are incuded as
>"arch/cc.h" and "arch/sys_arch.h".

This is correct.  IMO, no #includes should include anything other than a name.

>> Can you give examples of what the four search paths you needed were?
>> opt.h and err.h should both be in the same location as pbuf.h>At least for 
>> the current CVS code, the directories containing pbuf.h and
>cc.h should be enough, I think, since neither netif- nor ipv4-headers
>are included by pbuf.h.

Lwip/src
Lwip/src/include
Lwip/src/include/ipv4
And my arch folder

>Well, I do think there's some room for improvement in lwIP and I already
>improved a little. Especially tcp.h could be splitted into an external
>part (for applications) and an internal part (for the tcp
>implementation). Personally, I'm open to suggestions here.

There is opportunity for more hiding using forward struct declarations and 
putting the #include in the C file or even declaring the struct type in the C 
file that uses it.

Bill





reply via email to

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