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.
This commit is contained in:
Eugene Syromyatnikov 2018-05-07 08:24:56 +02:00 committed by Dmitry V. Levin
parent 30fe991db8
commit 10adc310cb

View File

@ -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__)