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__