This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: bool cdl_options
- From: Simon Kallweit <simon dot kallweit at intefo dot ch>
- To: Gary Thomas <gary at mlbassoc dot com>
- Cc: eCos Disuss <ecos-discuss at ecos dot sourceware dot org>
- Date: Wed, 03 Dec 2008 16:29:02 +0100
- Subject: Re: [ECOS] bool cdl_options
- References: <49369FE9.9000405@intefo.ch> <4936A286.90700@mlbassoc.com>
Gary Thomas wrote:
Simon Kallweit wrote:
Hi
Is there a simple way to have bool cdl_options output a "#define
OPTION_NAME 0" when the option is disabled?
What's wrong with using
#if !defined(OPTION_NAME)
That's the basic intent; boolean options are either defined
or not (they have no value)
True, so true. I'm in the process of porting the newest lwIP and they
want their boolean defines either to be 0 or 1. I have done the
following in the lwipopts.h:
#define PAP_SUPPORT defined(CYGFUN_LWIP_PAP_SUPPORT)
But this will give me "undefined reference to `defined`" compiler errors
in some rare places, as the PAP_SUPPORT define is not cleanly
substituted into a boolean value. I can do a construct like
#ifdef CYGFUN_LWIP_PAP_SUPPORT
# define PAP_SUPPORT 1
#else
# define PAP_SUPPORT 0
#endif
but I hoped there was a better way to accomplish that.
Any ideas?
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss