mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-08 11:02:24 +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)
|
||||
#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>
|
||||
* require it.
|
||||
|
Loading…
Reference in New Issue
Block a user