dovecot: Added N_ELEMENTS() macro.

dovecot at dovecot.org dovecot at dovecot.org
Fri Jul 20 17:39:15 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/6d2bee707053
changeset: 6128:6d2bee707053
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jul 20 17:21:53 2007 +0300
description:
Added N_ELEMENTS() macro.

diffstat:

1 file changed, 3 insertions(+)
src/lib/macros.h |    3 +++

diffs (13 lines):

diff -r 32e229d89038 -r 6d2bee707053 src/lib/macros.h
--- a/src/lib/macros.h	Fri Jul 20 17:21:41 2007 +0300
+++ b/src/lib/macros.h	Fri Jul 20 17:21:53 2007 +0300
@@ -14,6 +14,9 @@
 #ifndef TRUE
 #  define TRUE (!FALSE)
 #endif
+
+#define N_ELEMENTS(arr) \
+	(sizeof(arr) / sizeof((arr)[0]))
 
 #define BITS_IN_UINT (CHAR_BIT * sizeof(unsigned int))
 #define BITS_IN_SIZE_T (CHAR_BIT * sizeof(size_t))


More information about the dovecot-cvs mailing list