Re: [RFC PATCH] kconfig: introduce KCONFIG_* symbols for .c files

Adrian Bunk
2008-05-24T21:05:43Z

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