nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches

◆ IS_ENABLED_ANY

#define IS_ENABLED_ANY ( ...)

#include <include/util/util_macro.h>

Value:
Z_IS_ENABLED_ANY(__VA_ARGS__)
#define Z_IS_ENABLED_ANY(...)
Definition util_internal.h:58

Check multiple macro definitions to see if any is set in compiler-visible expressions.

This utilizes the same methodology as IS_ENABLED but on an variable number of argument. It will resolve as true (1) if any of the arguments in the input are defined to 1.

Example usage:

if (IS_ENABLED_ANY(CONFIG_FOO, CONFIG_BAR)) {
        do_something_if_any_of_these
}

This is cleaner since the compiler can generate errors and warnings for do_something_if_any_of_these even when CONFIG_FOO and/or CONFIG_BAR is undefined.

Parameters
...Arguments to check if at least one is defined to 1
Returns
1 if at least one param in ... is defined to 1, otherwise 0