util: add common ARRAY_SIZE define

I want to use this in more places, so put it in util.h rather than
copying & pasting it into another file.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Mike Frysinger 2013-04-15 22:13:16 -04:00 committed by David Gibson
parent b9e80656f2
commit 4ad49c3a9c
3 changed files with 2 additions and 3 deletions

View file

@ -50,8 +50,6 @@ static int saw_hyphen; /* = 0 */
static unsigned long long last_val;
static char *last_name; /* = NULL */
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
const struct {
const char *pattern;
int obase, width;