kconfig.h 802 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef __LINUX_KCONFIG_H
  2. #define __LINUX_KCONFIG_H
  3. #include <generated/autoconf.h>
  4. /*
  5. * Helper macros to use CONFIG_ options in C expressions. Note that
  6. * these only work with boolean and tristate options.
  7. */
  8. /*
  9. * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
  10. * 0 otherwise.
  11. *
  12. */
  13. #define IS_ENABLED(option) \
  14. (__enabled_ ## option || __enabled_ ## option ## _MODULE)
  15. /*
  16. * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
  17. * otherwise. For boolean options, this is equivalent to
  18. * IS_ENABLED(CONFIG_FOO).
  19. */
  20. #define IS_BUILTIN(option) __enabled_ ## option
  21. /*
  22. * IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0
  23. * otherwise.
  24. */
  25. #define IS_MODULE(option) __enabled_ ## option ## _MODULE
  26. #endif /* __LINUX_KCONFIG_H */