Skip to content

Commit b6c7be2

Browse files
committed
Add #ifndef ARRAY_SIZE
1 parent 8204eee commit b6c7be2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib/support/CodeUtils.h

+2
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,9 @@ inline void chipDie(void)
696696
* with a variable-length array argument, so we just do the C-compatible
697697
* thing in C++ as well.
698698
*/
699+
#ifndef ARRAY_SIZE
699700
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
701+
#endif
700702

701703
/**
702704
* @brief Ensures that if `str` is NULL, a non-null `default_str_value` is provided

0 commit comments

Comments
 (0)