1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-11-27 12:01:15 +03:00
Files
glibc/include/array_length.h
H. Peter Anvin c66801f361 include/array_length.h: add array_foreach[_const] macros
Add simple-to-use iterator macros for arrays.  They are used instead
of explicit for statements, like:

      /* Test all common speeds */
      array_foreach_const (ts, test_speeds)
	test (fd, *ts);

In this case, ts will be a const pointer to each of the elements of
test_speeds in turn.

Named array_foreach*() to allow for other kinds of equivalent iterator
macros in the future.

Signed-off-by: "H. Peter Anvin" (Intel) <hpa@zytor.com>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-06-17 09:57:40 -03:00

2.2 KiB