aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-02-21 15:07:41 -0500
committerIan Moffett <ian@osmora.org>2025-02-21 15:07:41 -0500
commit908a7c47131196470dbbe1719403e1bc1ea051f4 (patch)
treed30a4947f490ccc2427fa5302fcd8dabddcce4d7
parent2fde2c41f8541865595f3aac4aec274488aa6fef (diff)
defs: Add NELEM()
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--lib/include/defs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/include/defs.h b/lib/include/defs.h
index e621e71..25f5c4f 100644
--- a/lib/include/defs.h
+++ b/lib/include/defs.h
@@ -32,6 +32,7 @@
/* Compiler related defs */
#define ATTR(X) __attribute__((X))
+#define NELEM(X) (sizeof(X) / sizeof(X[0]))
#define PACKED ATTR(packed)
#define NORETURN ATTR(noreturn)