projects
/
platform
/
upstream
/
bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c1f0bb2
)
shared/util: Adding a shared ARRAY_SIZE macro
author
Alain Michaud
<alainm@chromium.org>
Tue, 7 Jan 2020 01:28:20 +0000
(
01:28
+0000)
committer
Ayush Garg
<ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:48 +0000
(14:30 +0530)
This will allow other implementations within src/ to use a single
definition of the ARRAY_SIZE macro.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/shared/util.h
patch
|
blob
|
history
diff --git
a/src/shared/util.h
b/src/shared/util.h
index
604dc3b
..
9193068
100755
(executable)
--- 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)