mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-10-14 15:05:39 +02:00
Add __arraycount() macro from NetBSD
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user