sys: util: Deprecate GET_ARG2 macro

GET_ARG_N should be used instead.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2020-05-11 09:06:08 +02:00 committed by Carles Cufí
commit dd9da9c8c4
2 changed files with 7 additions and 4 deletions

View file

@ -298,8 +298,8 @@ static inline char *log_strdup(const char *str)
#else #else
#define _LOG_LEVEL_RESOLVE(...) \ #define _LOG_LEVEL_RESOLVE(...) \
Z_LOG_EVAL(LOG_LEVEL, \ Z_LOG_EVAL(LOG_LEVEL, \
(GET_ARG2(__VA_ARGS__, LOG_LEVEL)), \ (GET_ARG_N(2, __VA_ARGS__, LOG_LEVEL)), \
(GET_ARG2(__VA_ARGS__, CONFIG_LOG_DEFAULT_LEVEL))) (GET_ARG_N(2, __VA_ARGS__, CONFIG_LOG_DEFAULT_LEVEL)))
#endif #endif
/* Return first argument */ /* Return first argument */

View file

@ -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__) #define GET_ARG1(...) GET_ARG_N(1, __VA_ARGS__)
/** @brief Expands to @p arg2 */ /** Expands to the second argument.
#define GET_ARG2(arg1, arg2, ...) arg2 *
* @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) */ /** @brief Expands to all arguments except the first one (@p val) */
#define GET_ARGS_LESS_1(val, ...) __VA_ARGS__ #define GET_ARGS_LESS_1(val, ...) __VA_ARGS__