From 18302b93fcff7b68b9e8e9c680e3d724195da3fe Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 9 Dec 2010 13:28:34 +0100 Subject: header: add MNL_ARRAY_SIZE(x) This patch adds MNL_ARRAY_SIZE(x) which likely to defined over and over again if you use mnl_cb_run2(...). Signed-off-by: Pablo Neira Ayuso --- include/libmnl/libmnl.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/libmnl/libmnl.h b/include/libmnl/libmnl.h index dc4d3dd..5b8d78c 100644 --- a/include/libmnl/libmnl.h +++ b/include/libmnl/libmnl.h @@ -164,6 +164,10 @@ extern int mnl_cb_run2(const void *buf, size_t numbytes, unsigned int seq, #define SOL_NETLINK 270 #endif +#ifndef MNL_ARRAY_SIZE +#define MNL_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) +#endif + #ifdef __cplusplus } /* extern "C" */ #endif -- cgit v1.2.3