[PATCH v5 2/3] Adding a shared ARRAY_SIZE macro.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <byteswap.h>
 #include <string.h>
 
+#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.24.1.735.g03f4e72817-goog




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux