]> granicus.if.org Git - strace/commitdiff
Introduce ARRSZ_PAIR macro
authorEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 7 May 2018 06:24:56 +0000 (08:24 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 30 May 2018 10:13:06 +0000 (10:13 +0000)
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.

macros.h

index d7e116ee2ae5f119c6bf4f7f1310323818b13384..f5334efbe6ec8e3f7c0672451749d1a5e4417b5f 100644 (file)
--- 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__)