Commit 30b4d507 authored by Guillem Jover's avatar Guillem Jover

Add __arraycount() macro from NetBSD

parent f6ed7c27
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment