blob: 067eda0e4b329cfbfbfcd0e1bb2e88a550c242d8 [file] [log] [blame]
Michal Marek2a11c8e2011-07-20 17:38:57 +02001#ifndef __LINUX_KCONFIG_H
2#define __LINUX_KCONFIG_H
3
4#include <generated/autoconf.h>
5
6/*
7 * Helper macros to use CONFIG_ options in C expressions. Note that
8 * these only work with boolean and tristate options.
9 */
10
11/*
12 * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
13 * 0 otherwise.
14 *
15 */
16#define IS_ENABLED(option) \
17 (__enabled_ ## option || __enabled_ ## option ## _MODULE)
18
19/*
20 * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
21 * otherwise. For boolean options, this is equivalent to
22 * IS_ENABLED(CONFIG_FOO).
23 */
24#define IS_BUILTIN(option) __enabled_ ## option
25
26/*
27 * IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0
28 * otherwise.
29 */
30#define IS_MODULE(option) __enabled_ ## option ## _MODULE
31
32#endif /* __LINUX_KCONFIG_H */