diff --git a/include/bsd/sys/cdefs.h b/include/bsd/sys/cdefs.h index d1cc419..98333d1 100644 --- a/include/bsd/sys/cdefs.h +++ b/include/bsd/sys/cdefs.h @@ -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 , , and * require it.