mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-04-01 12:01:31 +00:00
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> |
||
---|---|---|
.. | ||
byteorder | ||
clk | ||
mtd | ||
soc/ti | ||
unaligned | ||
usb | ||
apm_bios.h | ||
arm-smccc.h | ||
asn1.h | ||
asn1_ber_bytecode.h | ||
asn1_decoder.h | ||
bch.h | ||
bitfield.h | ||
bitmap.h | ||
bitops.h | ||
bitrev.h | ||
bug.h | ||
build_bug.h | ||
clk-provider.h | ||
compat.h | ||
compiler-clang.h | ||
compiler-gcc.h | ||
compiler-intel.h | ||
compiler.h | ||
compiler_attributes.h | ||
compiler_types.h | ||
completion.h | ||
const.h | ||
crc7.h | ||
crc32.h | ||
ctype.h | ||
delay.h | ||
dma-direction.h | ||
dma-mapping.h | ||
drm_dp_helper.h | ||
edd.h | ||
err.h | ||
errno.h | ||
ethtool.h | ||
fb.h | ||
if_ether.h | ||
immap_qe.h | ||
input.h | ||
io.h | ||
ioctl.h | ||
iopoll.h | ||
ioport.h | ||
kbuild.h | ||
kconfig.h | ||
kernel.h | ||
libfdt.h | ||
libfdt_env.h | ||
linkage.h | ||
linux_string.h | ||
list.h | ||
list_sort.h | ||
log2.h | ||
lzo.h | ||
math64.h | ||
mbus.h | ||
mc146818rtc.h | ||
mdio.h | ||
mii.h | ||
netdevice.h | ||
oid_registry.h | ||
poison.h | ||
posix_types.h | ||
printk.h | ||
psci.h | ||
rbtree.h | ||
rbtree_augmented.h | ||
screen_info.h | ||
serial_reg.h | ||
sizes.h | ||
stat.h | ||
stddef.h | ||
string.h | ||
stringify.h | ||
time.h | ||
typecheck.h | ||
types.h | ||
xxhash.h | ||
zstd.h |