Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
Misc utilities. More...
#include "util_loops.h"
#include "util_internal_is_eq.h"
#include "util_internal_util_inc.h"
#include "util_internal_util_dec.h"
#include "util_internal_util_x2.h"
Go to the source code of this file.
Macros | |
#define | UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__) |
#define | UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__ |
#define | UTIL_CHECK_N(x, n, ...) n |
#define | UTIL_CHECK(...) UTIL_CHECK_N(__VA_ARGS__, 0,) |
#define | UTIL_NOT(x) UTIL_CHECK(UTIL_PRIMITIVE_CAT(UTIL_NOT_, x)) |
#define | UTIL_NOT_0 ~, 1, |
#define | UTIL_COMPL(b) UTIL_PRIMITIVE_CAT(UTIL_COMPL_, b) |
#define | UTIL_COMPL_0 1 |
#define | UTIL_COMPL_1 0 |
#define | UTIL_BOOL(x) UTIL_COMPL(UTIL_NOT(x)) |
#define | UTIL_EVAL(...) __VA_ARGS__ |
#define | UTIL_EXPAND(...) __VA_ARGS__ |
#define | UTIL_REPEAT(...) UTIL_LISTIFY(__VA_ARGS__) |
#define | NUM_VA_ARGS_LESS_1_IMPL( _ignored, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, N, ...) N |
#define | MACRO_MAP_CAT_(...) |
#define | MACRO_MAP_CAT_N_(N, ...) UTIL_CAT(MACRO_MC_, N)(__VA_ARGS__,) |
#define | MACRO_MC_0(...) |
#define | MACRO_MC_1(m, a, ...) m(a) |
#define | MACRO_MC_2(m, a, ...) UTIL_CAT(m(a), MACRO_MC_1(m, __VA_ARGS__,)) |
#define | MACRO_MC_3(m, a, ...) UTIL_CAT(m(a), MACRO_MC_2(m, __VA_ARGS__,)) |
#define | MACRO_MC_4(m, a, ...) UTIL_CAT(m(a), MACRO_MC_3(m, __VA_ARGS__,)) |
#define | MACRO_MC_5(m, a, ...) UTIL_CAT(m(a), MACRO_MC_4(m, __VA_ARGS__,)) |
#define | MACRO_MC_6(m, a, ...) UTIL_CAT(m(a), MACRO_MC_5(m, __VA_ARGS__,)) |
#define | MACRO_MC_7(m, a, ...) UTIL_CAT(m(a), MACRO_MC_6(m, __VA_ARGS__,)) |
#define | MACRO_MC_8(m, a, ...) UTIL_CAT(m(a), MACRO_MC_7(m, __VA_ARGS__,)) |
#define | MACRO_MC_9(m, a, ...) UTIL_CAT(m(a), MACRO_MC_8(m, __VA_ARGS__,)) |
#define | MACRO_MC_10(m, a, ...) UTIL_CAT(m(a), MACRO_MC_9(m, __VA_ARGS__,)) |
#define | MACRO_MC_11(m, a, ...) UTIL_CAT(m(a), MACRO_MC_10(m, __VA_ARGS__,)) |
#define | MACRO_MC_12(m, a, ...) UTIL_CAT(m(a), MACRO_MC_11(m, __VA_ARGS__,)) |
#define | MACRO_MC_13(m, a, ...) UTIL_CAT(m(a), MACRO_MC_12(m, __VA_ARGS__,)) |
#define | MACRO_MC_14(m, a, ...) UTIL_CAT(m(a), MACRO_MC_13(m, __VA_ARGS__,)) |
#define | MACRO_MC_15(m, a, ...) UTIL_CAT(m(a), MACRO_MC_14(m, __VA_ARGS__,)) |
Misc utilities.
Repetitive or obscure helper macros needed by sys/util.h.
#define MACRO_MAP_CAT_ | ( | ... | ) |
#define MACRO_MAP_CAT_N_ | ( | N, | |
... | |||
) | UTIL_CAT(MACRO_MC_, N)(__VA_ARGS__,) |
#define MACRO_MC_0 | ( | ... | ) |
#define MACRO_MC_1 | ( | m, | |
a, | |||
... | |||
) | m(a) |
#define MACRO_MC_10 | ( | m, | |
a, | |||
... | |||
) | UTIL_CAT(m(a), MACRO_MC_9(m, __VA_ARGS__,)) |
#define MACRO_MC_11 | ( | m, | |
a, | |||
... | |||
) | UTIL_CAT(m(a), MACRO_MC_10(m, __VA_ARGS__,)) |
#define MACRO_MC_12 | ( | m, | |
a, | |||
... | |||
) | UTIL_CAT(m(a), MACRO_MC_11(m, __VA_ARGS__,)) |
#define MACRO_MC_13 | ( | m, | |
a, | |||
... | |||
) | UTIL_CAT(m(a), MACRO_MC_12(m, __VA_ARGS__,)) |
#define MACRO_MC_14 | ( | m, | |
a, | |||
... | |||
) | UTIL_CAT(m(a), MACRO_MC_13(m, __VA_ARGS__,)) |
#define MACRO_MC_15 | ( | m, | |
a, | |||
... | |||
) | UTIL_CAT(m(a), MACRO_MC_14(m, __VA_ARGS__,)) |
#define MACRO_MC_2 | ( | m, | |
a, | |||
... | |||
) | UTIL_CAT(m(a), MACRO_MC_1(m, __VA_ARGS__,)) |
#define MACRO_MC_3 | ( | m, | |
a, | |||
... | |||
) | UTIL_CAT(m(a), MACRO_MC_2(m, __VA_ARGS__,)) |
#define MACRO_MC_4 | ( | m, | |
a, | |||
... | |||
) | UTIL_CAT(m(a), MACRO_MC_3(m, __VA_ARGS__,)) |
#define MACRO_MC_5 | ( | m, | |
a, | |||
... | |||
) | UTIL_CAT(m(a), MACRO_MC_4(m, __VA_ARGS__,)) |
#define MACRO_MC_6 | ( | m, | |
a, | |||
... | |||
) | UTIL_CAT(m(a), MACRO_MC_5(m, __VA_ARGS__,)) |
#define MACRO_MC_7 | ( | m, | |
a, | |||
... | |||
) | UTIL_CAT(m(a), MACRO_MC_6(m, __VA_ARGS__,)) |
#define MACRO_MC_8 | ( | m, | |
a, | |||
... | |||
) | UTIL_CAT(m(a), MACRO_MC_7(m, __VA_ARGS__,)) |
#define MACRO_MC_9 | ( | m, | |
a, | |||
... | |||
) | UTIL_CAT(m(a), MACRO_MC_8(m, __VA_ARGS__,)) |
#define NUM_VA_ARGS_LESS_1_IMPL | ( | _ignored, | |
_0, | |||
_1, | |||
_2, | |||
_3, | |||
_4, | |||
_5, | |||
_6, | |||
_7, | |||
_8, | |||
_9, | |||
_10, | |||
_11, | |||
_12, | |||
_13, | |||
_14, | |||
_15, | |||
_16, | |||
_17, | |||
_18, | |||
_19, | |||
_20, | |||
_21, | |||
_22, | |||
_23, | |||
_24, | |||
_25, | |||
_26, | |||
_27, | |||
_28, | |||
_29, | |||
_30, | |||
_31, | |||
_32, | |||
_33, | |||
_34, | |||
_35, | |||
_36, | |||
_37, | |||
_38, | |||
_39, | |||
_40, | |||
_41, | |||
_42, | |||
_43, | |||
_44, | |||
_45, | |||
_46, | |||
_47, | |||
_48, | |||
_49, | |||
_50, | |||
_51, | |||
_52, | |||
_53, | |||
_54, | |||
_55, | |||
_56, | |||
_57, | |||
_58, | |||
_59, | |||
_60, | |||
_61, | |||
_62, | |||
N, | |||
... | |||
) | N |
#define UTIL_BOOL | ( | x | ) | UTIL_COMPL(UTIL_NOT(x)) |
#define UTIL_CAT | ( | a, | |
... | |||
) | UTIL_PRIMITIVE_CAT(a, __VA_ARGS__) |
#define UTIL_CHECK | ( | ... | ) | UTIL_CHECK_N(__VA_ARGS__, 0,) |
#define UTIL_CHECK_N | ( | x, | |
n, | |||
... | |||
) | n |
#define UTIL_COMPL | ( | b | ) | UTIL_PRIMITIVE_CAT(UTIL_COMPL_, b) |
#define UTIL_COMPL_0 1 |
#define UTIL_COMPL_1 0 |
#define UTIL_EVAL | ( | ... | ) | __VA_ARGS__ |
#define UTIL_EXPAND | ( | ... | ) | __VA_ARGS__ |
#define UTIL_NOT | ( | x | ) | UTIL_CHECK(UTIL_PRIMITIVE_CAT(UTIL_NOT_, x)) |
#define UTIL_NOT_0 ~, 1, |
#define UTIL_PRIMITIVE_CAT | ( | a, | |
... | |||
) | a##__VA_ARGS__ |
#define UTIL_REPEAT | ( | ... | ) | UTIL_LISTIFY(__VA_ARGS__) |