1
0
mirror of https://xff.cz/git/u-boot/ synced 2026-01-21 14:27:22 +01:00
Files
u-boot-megous/include
Rasmus Villemoes 7842749c35 linux/kconfig.h: create two- and three-argument versions of CONFIG_IS_ENABLED
This adds a bunch of preprocessor magic to extend the capabilities of
CONFIG_IS_ENABLED. The existing semantics of

  CONFIG_IS_ENABLED(FOO)

expanding to a 1 or 0 (depending on build context and the defined-ness
or not of the appropriate CONFIG_FOO/CONFIG_SPL_FOO/CONFIG_TPL_FOO)
are of course preserved. With this, one is also allowed a two-argument
form

  CONFIG_IS_ENABLED(FOO, (something))

which expands to something precisely when CONFIG_IS_ENABLED(FOO) would
expand to 1, and expands to nothing otherwise. It is, in other words,
completely equivalent to the three lines

  #if CONFIG_IS_ENABLED(FOO)
  something
  #endif

The second argument must be parenthesized in order to allow any
tokens, including a trailing comma, to appear - one use case for this
is precisely to make it a bit more ergonomic to build an array and
only include certain items depending on .config. That should increase
both readability and not least "git grep"ability.

A third variant is also introduced,

  CONFIG_IS_ENABLED(FOO, (xxx), (yyy))

which corresponds to

  #if CONFIG_IS_ENABLED(FOO)
  xxx
  #else
  yyy
  #endif

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-09 12:33:24 +08:00
..
2020-07-01 15:01:21 +08:00
2019-12-06 16:44:20 -05:00
2019-10-16 05:42:27 +02:00
2020-07-01 15:01:21 +08:00
2020-05-11 10:16:49 +05:30
2020-04-17 12:32:36 -04:00
2020-05-18 18:36:55 -04:00
2020-05-18 18:36:55 -04:00
2020-05-18 17:33:33 -04:00
2020-02-05 19:33:46 -07:00
2020-05-11 01:30:49 +05:30
2020-05-25 11:54:53 -04:00
2019-04-23 20:26:43 -06:00
2020-02-05 19:33:46 -07:00
2019-10-13 23:34:43 +02:00
2020-05-07 09:01:42 -04:00
2020-05-18 21:19:23 -04:00
2020-05-18 17:33:33 -04:00
2020-04-29 11:10:54 +05:30
2020-05-18 17:33:33 -04:00
2020-06-12 13:14:07 -04:00
2019-02-20 15:27:09 +08:00
2018-06-13 07:49:12 -04:00
2018-12-06 23:26:32 -05:00
2020-05-18 21:19:18 -04:00
2019-02-09 12:50:22 -07:00
2019-10-14 09:31:41 +02:00
2020-01-20 15:38:16 +01:00
2018-12-05 06:01:35 -07:00
2019-11-07 18:39:16 -05:00
2018-04-06 17:04:33 -04:00
2020-05-18 18:36:55 -04:00
2019-08-11 16:43:41 -04:00
2020-04-17 12:32:36 -04:00
2002-09-17 21:37:55 +00:00
2019-02-02 08:19:17 -05:00
2020-05-18 18:36:55 -04:00
2019-12-02 18:23:11 -05:00
2020-01-25 12:04:36 -05:00
2020-06-12 13:17:23 -04:00
2020-02-05 19:33:46 -07:00
2019-12-15 11:44:11 +08:00
2018-10-09 04:40:27 -06:00
2020-05-18 17:33:33 -04:00
2020-05-15 13:53:50 -04:00
2019-05-20 13:50:34 +02:00
2020-06-14 21:07:20 +02:00
2020-02-05 19:33:46 -07:00
2020-06-14 21:07:20 +02:00
2019-12-06 16:44:19 -05:00
2020-05-18 17:33:31 -04:00
2020-05-18 18:36:55 -04:00
2018-07-19 16:31:37 -04:00
2020-02-05 19:33:46 -07:00
2019-02-01 16:59:12 +01:00
2019-05-21 17:33:23 -06:00
2018-07-20 15:55:05 -04:00
2018-10-09 04:40:27 -06:00
2020-01-24 23:06:49 +05:30
2020-01-21 15:56:15 +01:00
2020-04-24 16:40:09 -04:00
2018-09-28 18:26:32 +02:00
2020-05-18 21:19:18 -04:00