mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-31 20:30:09 +01:00
util: add ARRAY_FOR_EACH helper
Requires c99, but that's the future. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
95c6ac638f
commit
b59d9c537b
1 changed files with 2 additions and 0 deletions
|
|
@ -70,6 +70,8 @@ int list_empty(const struct list *list);
|
|||
tmp = container_of(pos->member.next, tmp, member))
|
||||
|
||||
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
|
||||
#define ARRAY_FOR_EACH(_arr, _elem) \
|
||||
for (int i = 0; (_elem = &_arr[i]) && i < ARRAY_LENGTH(_arr); i++)
|
||||
|
||||
/*
|
||||
* This fixed point implementation is a verbatim copy from wayland-util.h from
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue