From 42f3e18b53c99a5048f00252fd81800ee1a60687 Mon Sep 17 00:00:00 2001 From: Alain Michaud Date: Tue, 7 Jan 2020 01:28:20 +0000 Subject: [PATCH] shared/util: Adding a shared ARRAY_SIZE macro This will allow other implementations within src/ to use a single definition of the ARRAY_SIZE macro. --- src/shared/util.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shared/util.h b/src/shared/util.h index 604dc3be4..9193068d1 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -27,6 +27,8 @@ #include #include +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) + #if __BYTE_ORDER == __LITTLE_ENDIAN #define le16_to_cpu(val) (val) #define le32_to_cpu(val) (val) -- 2.47.3