From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24426 invoked by alias); 30 Jul 2009 09:11:05 -0000 Received: (qmail 24418 invoked by uid 22791); 30 Jul 2009 09:11:04 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-ew0-f207.google.com (HELO mail-ew0-f207.google.com) (209.85.219.207) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 30 Jul 2009 09:10:57 +0000 Received: by ewy3 with SMTP id 3so676291ewy.30 for ; Thu, 30 Jul 2009 02:10:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.3.206 with SMTP id 56mr185966weh.99.1248945053715; Thu, 30 Jul 2009 02:10:53 -0700 (PDT) Date: Thu, 30 Jul 2009 09:11:00 -0000 Message-ID: From: David Fernandez To: ecos-discuss@ecos.sourceware.org Cc: Sergei Gavrikov , Simon Kallweit Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS]How to run testprograms for lwip X-SW-Source: 2009-07/txt/msg00269.txt.bz2 > #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