summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2010-12-09 13:28:34 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2010-12-09 13:28:34 +0100
commit18302b93fcff7b68b9e8e9c680e3d724195da3fe (patch)
tree128b2896bba86743d35b350ea71e0b9f1568f4a5 /include
parentbbe1f68ded15a3579d26d8c3f23e9c3941296193 (diff)
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 <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r--include/libmnl/libmnl.h4
1 files changed, 4 insertions, 0 deletions
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