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

From: Jeremy Fitzhardinge
Date: Sat May 24 2008 - 17:14:30 EST


Adrian Bunk wrote:
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.)

You and your scientific method.

Yeah, this is one of those cases where you need cpp to rescan its input after pasting, and I don't think it will ever do that.

J
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/