projects
/
libusual.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f7f63e4
)
base: ARRAY_NELEM() macro for static arrays
author
Marko Kreen
<markokr@gmail.com>
Mon, 21 Dec 2009 13:06:53 +0000
(15:06 +0200)
committer
Marko Kreen
<markokr@gmail.com>
Wed, 3 Mar 2010 07:50:28 +0000
(09:50 +0200)
usual/base.h
patch
|
blob
|
blame
|
history
diff --git
a/usual/base.h
b/usual/base.h
index 590786e747e97bc2db473714f595c047a05d6912..247dcf983f5df0a8c9a41c21b319fcd232afedca 100644
(file)
--- a/
usual/base.h
+++ b/
usual/base.h
@@
-60,6
+60,9
@@
#define ALIGN(x) CUSTOM_ALIGN(x, sizeof(long))
#endif
+/* number of elements in array */
+#define ARRAY_NELEM(a) (sizeof(a) / sizeof((a)[0]))
+
#define _PACKED __attribute__((packed))
/*