mirror of
https://github.com/shadow-maint/shadow.git
synced 2026-01-26 22:12:26 +00:00
countof() is the name blessed by the C Committee for ISO C2y. Use it if available, and define it if not. countof() will be provided by GCC 16 and Clang 21. This is mostly a scripted change: $ grep -rl NITEMS | xargs sed -i s/NITEMS/countof/; Apart from the scripted changes, I've adjusted white-space alignment, and of course the definition at "lib/sizeof.h". Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3550.pdf#subsubsection.0.6.5.4.5> Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3550.pdf#section.0.7.21> Signed-off-by: Alejandro Colomar <alx@kernel.org>