From 382cd7a3718b03995f64a59e3ffc292ac927fa88 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Tue, 17 Jan 2023 19:25:21 +0100 Subject: [PATCH] Add ARRAYLEN macro --- src/include/common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/include/common.h b/src/include/common.h index 1caee4c..068635e 100644 --- a/src/include/common.h +++ b/src/include/common.h @@ -29,6 +29,8 @@ #define USE_RET __attribute__((warn_unused_result)) +#define ARRAYLEN(x) (sizeof(x)/sizeof((x)[0])) + /* clang-format on */ #endif /* COMMON_H */