mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-09 11:17:37 +01:00
Add __arraycount() macro from NetBSD
This commit is contained in:
parent
f6ed7c278b
commit
30b4d50754
@ -155,6 +155,12 @@
|
|||||||
# define __bounded__(x, y, z)
|
# define __bounded__(x, y, z)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return the number of elements in a statically-allocated array,
|
||||||
|
* __x.
|
||||||
|
*/
|
||||||
|
#define __arraycount(__x) (sizeof(__x) / sizeof(__x[0]))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h>
|
* We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h>
|
||||||
* require it.
|
* require it.
|
||||||
|
Loading…
Reference in New Issue
Block a user