From 80a21dc60fa007bb00437fdc047c3e059232639f Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 8 May 2012 13:32:12 +0200 Subject: lib: add array_size() helper implement array_size as sizeof(array) / sizeof(array element) Signed-off-by: David Lamparter --- lib/memory.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/memory.h b/lib/memory.h index a7eddce4..23962235 100644 --- a/lib/memory.h +++ b/lib/memory.h @@ -21,6 +21,8 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #ifndef _ZEBRA_MEMORY_H #define _ZEBRA_MEMORY_H +#define array_size(ar) (sizeof(ar) / sizeof(ar[0])) + /* For pretty printing of memory allocate information. */ struct memory_list { -- cgit v1.2.1