From dd9da9c8c4a874c83c65b889a5ea23b0ca0dd1e7 Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Mon, 11 May 2020 09:06:08 +0200 Subject: [PATCH] sys: util: Deprecate GET_ARG2 macro GET_ARG_N should be used instead. Signed-off-by: Krzysztof Chruscinski --- include/logging/log.h | 4 ++-- include/sys/util.h | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/logging/log.h b/include/logging/log.h index c585c4d21a1..a4ba492eb02 100644 --- a/include/logging/log.h +++ b/include/logging/log.h @@ -298,8 +298,8 @@ static inline char *log_strdup(const char *str) #else #define _LOG_LEVEL_RESOLVE(...) \ Z_LOG_EVAL(LOG_LEVEL, \ - (GET_ARG2(__VA_ARGS__, LOG_LEVEL)), \ - (GET_ARG2(__VA_ARGS__, CONFIG_LOG_DEFAULT_LEVEL))) + (GET_ARG_N(2, __VA_ARGS__, LOG_LEVEL)), \ + (GET_ARG_N(2, __VA_ARGS__, CONFIG_LOG_DEFAULT_LEVEL))) #endif /* Return first argument */ diff --git a/include/sys/util.h b/include/sys/util.h index 4f9a94dbdf4..ff73aaceee3 100644 --- a/include/sys/util.h +++ b/include/sys/util.h @@ -560,8 +560,11 @@ uint8_t u8_to_dec(char *buf, uint8_t buflen, uint8_t value); */ #define GET_ARG1(...) GET_ARG_N(1, __VA_ARGS__) -/** @brief Expands to @p arg2 */ -#define GET_ARG2(arg1, arg2, ...) arg2 +/** Expands to the second argument. + * + * @deprecated Use GET_ARG_N instead. + */ +#define GET_ARG2(...) __DEPRECATED GET_ARG_N(2, __VA_ARGS__) /** @brief Expands to all arguments except the first one (@p val) */ #define GET_ARGS_LESS_1(val, ...) __VA_ARGS__