mirror of https://github.com/ArduPilot/ardupilot
AP_Common: added ARRAY_SIZE_SIMPLE()
this works with zero length arrays
This commit is contained in:
parent
468cadca45
commit
7aeab8f5a8
|
@ -79,6 +79,9 @@ char (&_ARRAY_SIZE_HELPER(T (&_arr)[0]))[0];
|
|||
|
||||
#define ARRAY_SIZE(_arr) sizeof(_ARRAY_SIZE_HELPER(_arr))
|
||||
|
||||
// simpler ARRAY_SIZE which can handle zero elements
|
||||
#define ARRAY_SIZE_SIMPLE(_arr) (sizeof(_arr)/sizeof(_arr[0]))
|
||||
|
||||
/*
|
||||
* See UNUSED_RESULT. The difference is that it receives @uniq_ as the name to
|
||||
* be used for its internal variable.
|
||||
|
|
Loading…
Reference in New Issue