mirror of
https://github.com/espressif/openthread.git
synced 2026-08-12 21:57:47 +00:00
[diag] use OT_ARRAY_LENGTH to unify code and shrink image size (#3677)
This commit is contained in:
committed by
Jonathan Hui
parent
6dc3b28b3f
commit
c02a985609
@@ -71,4 +71,14 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* This macro calculates the number of elements in an array.
|
||||
*
|
||||
* @param[in] aArray Name of the array variable.
|
||||
*
|
||||
* @returns Number of elements in the array.
|
||||
*
|
||||
*/
|
||||
#define otARRAY_LENGTH(aArray) (sizeof(aArray) / sizeof(aArray[0]))
|
||||
|
||||
#endif // CODE_UTILS_H
|
||||
|
||||
Reference in New Issue
Block a user