From: Eugene Syromyatnikov Date: Mon, 7 May 2018 06:24:56 +0000 (+0200) Subject: Introduce ARRSZ_PAIR macro X-Git-Tag: v4.23~90 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10adc310cbd3e9f0b1703646946f82788a6731aa;p=strace Introduce ARRSZ_PAIR macro A shorthand similar to ARG_STR in its purpose: it provides and ability to pass an array an its size without variable name duplication. * macros.h (ARRSZ_PAIR): New macro. --- diff --git a/macros.h b/macros.h index d7e116ee..f5334efb 100644 --- a/macros.h +++ b/macros.h @@ -35,6 +35,8 @@ #define ARRAY_SIZE(a_) (sizeof(a_) / sizeof((a_)[0]) + MUST_BE_ARRAY(a_)) +#define ARRSZ_PAIR(a_) a_, ARRAY_SIZE(a_) + #define STRINGIFY(...) #__VA_ARGS__ #define STRINGIFY_VAL(...) STRINGIFY(__VA_ARGS__)