commit | 4ad49c3a9cdaccac02cd448c2704ea52ad85d1dc | [log] [tgz] |
---|---|---|
author | Mike Frysinger <[email protected]> | Mon Apr 15 22:13:16 2013 -0400 |
committer | David Gibson <[email protected]> | Fri May 24 18:20:53 2013 +1000 |
tree | d09e4c77401812a5142a85f4cbe38980b29e30f6 | |
parent | b9e80656f2de441826ed2ff1cd9c5d43b3ae43d3 [diff] [blame] |
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 <[email protected]> Signed-off-by: David Gibson <[email protected]>
diff --git a/util.h b/util.h index 7b9a840..8f40b44 100644 --- a/util.h +++ b/util.h
@@ -24,6 +24,8 @@ * USA */ +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + static inline void __attribute__((noreturn)) die(const char *str, ...) { va_list ap;