include: Add nitems() definition to sys/param.h
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
3f3e090716
commit
cf0769d613
@ -43,6 +43,14 @@
|
||||
# define MAX(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif /* MAX */
|
||||
|
||||
/* Macros for number of items.
|
||||
* (aka. ARRAY_SIZE, ArraySize, Size of an Array)
|
||||
*/
|
||||
|
||||
#ifndef nitems
|
||||
# define nitems(_a) (sizeof(_a) / sizeof(0[(_a)]))
|
||||
#endif /* nitems */
|
||||
|
||||
/****************************************************************************
|
||||
* Public Type Definitions
|
||||
****************************************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user