Add __arraycount() macro from NetBSD

This commit is contained in:
Guillem Jover 2018-05-21 03:00:47 +02:00
parent f6ed7c278b
commit 30b4d50754

View File

@ -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.