From 0813a80223e40a5d122dfa86ea41e7b1c986f093 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 5 May 2012 20:26:54 -0400 Subject: add a new ARRAY_SIZE macro and use it Signed-off-by: Mike Frysinger --- src/includes/helpers.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/includes') diff --git a/src/includes/helpers.h b/src/includes/helpers.h index 39b192a..94e59a8 100644 --- a/src/includes/helpers.h +++ b/src/includes/helpers.h @@ -46,6 +46,8 @@ # define _unused #endif +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) + /* Some libc implemntations don't have these */ #ifndef TAILQ_CONCAT #define TAILQ_CONCAT(head1, head2, field) do { \ -- cgit v1.2.3