summaryrefslogtreecommitdiff
path: root/src/includes
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-05-05 20:26:54 -0400
committerMike Frysinger <vapier@gentoo.org>2012-05-06 01:17:30 -0400
commit0813a80223e40a5d122dfa86ea41e7b1c986f093 (patch)
tree5db7aa55008ae1cb076c959849d0cd5481d3fed4 /src/includes
parent3969cb2a85d798cd029043566d97aad66dcee8e5 (diff)
downloadopenrc-0813a80223e40a5d122dfa86ea41e7b1c986f093.tar.gz
openrc-0813a80223e40a5d122dfa86ea41e7b1c986f093.tar.bz2
openrc-0813a80223e40a5d122dfa86ea41e7b1c986f093.tar.xz
add a new ARRAY_SIZE macro and use it
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'src/includes')
-rw-r--r--src/includes/helpers.h2
1 files changed, 2 insertions, 0 deletions
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 { \