aboutsummaryrefslogtreecommitdiffstats
path: root/src/system.h
diff options
context:
space:
mode:
authorCollin Funk <collin.funk1@gmail.com>2025-09-23 19:17:14 -0700
committerCollin Funk <collin.funk1@gmail.com>2025-09-24 17:31:57 -0700
commit1bc5ec61d8d960e1679b42f55c8f96992ced34ef (patch)
treeaa458fa9307db7b5b4a9e7704eccc515842112ba /src/system.h
parenttail: fix tailing larger number of lines in regular files (diff)
downloadcoreutils-1bc5ec61d8d960e1679b42f55c8f96992ced34ef.tar.gz
coreutils-1bc5ec61d8d960e1679b42f55c8f96992ced34ef.zip
maint: prefer countof over ARRAY_CARDINALITY
* bootstrap.conf (gnulib_modules): Add stdcountof-h. * src/system.h: Include stdcountof.h. (ARRAY_CARDINALITY): Remove definition. * .gitignore (/lib/stdcountof.h): Ignore Gnulib generated file. * src/csplit.c: Use countof instead of ARRAY_CARDINALITY. * src/df.c: Likewise. * src/digest.c: Likewise. * src/dircolors.c: Likewise. * src/factor.c: Likewise. * src/join.c: Likewise. * src/ls.c: Likewise. * src/od.c: Likewise. * src/sort.c: Likewise. * src/stdbuf.c: Likewise. * src/tr.c: Likewise.
Diffstat (limited to 'src/system.h')
-rw-r--r--src/system.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/system.h b/src/system.h
index a7ae5a5f3..b8612ff5e 100644
--- a/src/system.h
+++ b/src/system.h
@@ -68,6 +68,7 @@
#endif
#include <stdckdint.h>
+#include <stdcountof.h>
#include <stddef.h>
#include <string.h>
#include <uchar.h>
@@ -770,10 +771,6 @@ stzncpy (char *restrict dest, char const *restrict src, size_t len)
return dest;
}
-#ifndef ARRAY_CARDINALITY
-# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
-#endif
-
/* Return true if ERR is ENOTSUP or EOPNOTSUPP, otherwise false.
This wrapper function avoids the redundant 'or'd comparison on
systems like Linux for which they have the same value. It also