mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
compiler: Add NELEMS_AS_ARRAY helper
To count elems in accumulator. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
parent
0fb2f0e56a
commit
a3a42a4ce7
1 changed files with 1 additions and 0 deletions
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
#define NELEMS_AS_ARRAY(x,y) (sizeof(x) / sizeof((y)[0]))
|
||||
#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
|
||||
|
||||
#define ASSIGN_TYPED(a, b) do { (a) = (typeof(a))(b); } while (0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue