public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@kernel.org>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Sam Ravnborg <sam@ravnborg.org>,
	linux-kbuild <linux-kbuild@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Roman Zippel <zippel@linux-m68k.org>,
	Tom Spink <tspink@gmail.com>
Subject: Re: [RFC PATCH] kconfig: introduce KCONFIG_* symbols for .c files
Date: Sun, 25 May 2008 00:03:04 +0300	[thread overview]
Message-ID: <20080524210304.GD2308@cs181133002.pp.htv.fi> (raw)
In-Reply-To: <48388187.2070503@goop.org>

On Sat, May 24, 2008 at 09:58:47PM +0100, Jeremy Fitzhardinge wrote:
> 
> Would
>
>    #define KCONFIG(x)   (CONFIG_##x - 0)
>
>    if (KCONFIG(PREEMPT)) {
>        ...
>    }
>
> work?

$ cat test.c
#define KCONFIG(x)   (CONFIG_##x - 0)

int main()
{
  if (KCONFIG(PREEMPT))
    ;

  return 0;
}
$ gcc -O2 -Wall test.c
test.c: In function ‘main’:
test.c:5: error: ‘CONFIG_PREEMPT’ undeclared (first use in this function)
test.c:5: error: (Each undeclared identifier is reported only once
test.c:5: error: for each function it appears in.)
$ gcc --version
gcc (Debian 4.3.0-5) 4.3.1 20080523 (prerelease)

>    J

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


  reply	other threads:[~2008-05-24 21:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-24 19:25 [RFC PATCH] kconfig: introduce KCONFIG_* symbols for .c files Sam Ravnborg
2008-05-24 19:53 ` Andrew Morton
2008-05-24 20:14   ` Jeremy Fitzhardinge
2008-05-24 20:46     ` Sam Ravnborg
2008-05-24 20:56       ` Jeremy Fitzhardinge
2008-05-24 21:03         ` Sam Ravnborg
2008-05-24 20:24   ` Sam Ravnborg
2008-05-24 20:48     ` Andrew Morton
2008-05-24 21:00       ` Sam Ravnborg
2008-05-24 20:05 ` Adrian Bunk
2008-05-24 20:44   ` Sam Ravnborg
2008-05-24 20:57     ` Adrian Bunk
2008-05-24 20:20 ` Linus Torvalds
2008-05-24 20:37   ` [PATCH] x86: use defconfig as last resort Sam Ravnborg
2008-05-25  1:30     ` Linus Torvalds
2008-05-25  6:15       ` Sam Ravnborg
2008-05-25  6:22       ` Sam Ravnborg
2008-05-24 20:48 ` [RFC PATCH] kconfig: introduce KCONFIG_* symbols for .c files Jeremy Fitzhardinge
2008-05-24 20:58   ` Jeremy Fitzhardinge
2008-05-24 21:03     ` Adrian Bunk [this message]
2008-05-24 21:13       ` Jeremy Fitzhardinge
2008-05-24 21:26 ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080524210304.GD2308@cs181133002.pp.htv.fi \
    --to=bunk@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=jeremy@goop.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tspink@gmail.com \
    --cc=zippel@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox