]> granicus.if.org Git - procps-ng/commitdiff
library: added MAXTABLE macro to proc/procps-private.h
authorJim Warner <james.warner@comcast.net>
Mon, 10 Aug 2020 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Thu, 13 Aug 2020 11:08:58 +0000 (21:08 +1000)
This macro should help the following patch be a little
less prolix. Besides, this private header could/should
do just a little more to help with our newlib efforts.

Signed-off-by: Jim Warner <james.warner@comcast.net>
proc/procps-private.h

index 2374f1b6153b789db2b90d006a9ecf2f4a24048a..be970bd897a8b55d0145ef761ecd89bb3350cde9 100644 (file)
@@ -24,5 +24,6 @@
 #define STRINGIFY_ARG(a)       #a
 #define STRINGIFY(a)           STRINGIFY_ARG(a)
 
+#define MAXTABLE(t)            (int)(sizeof(t) / sizeof(t[0]))
 
 #endif