This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to run testprograms for lwip


> #if defined(CYGFUN_LWIP_IP_FORWARD)
> # define IP_FORWARD 1
> #else
> # define IP_FORWARD 0
> #endif
>
> FYI: There are a few defines like this
>
> #define FOO defined(CYG_FOO)
>
> in lwipopts.h. Small testcase:
>
> #define CYG_FOO 1
> #define FOO defined(CYG_FOO)
>
> main ()
> {
> int foo = FOO;
> }
>
> It cannot be linked. FOO is not boolean ;-) I can check the same
> "rvalues" then and send a patch if you want.
>

May be I'm wrong, but I think that the macro CYG_FUN_LWIP_IP_FORWARD
is not only defined, but defined as 1 if the option is enabled. May be
that what you want is to use the macro directly instead of the
preprocessor operator applied to it.

That is simpler than defining another macro, and if the option is
disabled, the macro would be defined, but its value would be 0.

You might want to check it this way though, in case the lwip is
included, but those CDL options are not active for some reason...
which may be impossible, but here you are.

#ifndef CYG_FUN_LWIP_IP_FORWARD
#define IP_FORWARD 0
#else
#define IP_FORWARD CYG_FUN_LWIP_IP_FORWARD
#endif

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]