summaryrefslogtreecommitdiff
path: root/include/libc-internal.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-11-27 04:10:03 -0500
committerMike Frysinger <vapier@gentoo.org>2011-11-27 04:33:03 -0500
commit0405cb8f5b647fadf61f7539828ef88a883223e2 (patch)
treef799c19215d15fd1ce8977135c4c18a35fae15ff /include/libc-internal.h
parent9ca7a065beaee93969b39117a7f6d466ff2fb171 (diff)
make ARRAY_SIZE commonly available internally
Some places have opencoded the ARRAY_SIZE macro, so move it to a global internal location so other places can leverage it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'include/libc-internal.h')
-rw-r--r--include/libc-internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/libc-internal.h b/include/libc-internal.h
index 3ac0b0509..9fb1ea2a3 100644
--- a/include/libc-internal.h
+++ b/include/libc-internal.h
@@ -74,6 +74,8 @@ libc_hidden_proto(__chk_fail)
#endif /* __ASSEMBLER__ */
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+
/* Some people like to build up uClibc with *-elf toolchains, so
* a little grease here until we drop '#ifdef __linux__' checks
* from our source code.