Fix bug #51238: LWIP_ARRAYSIZE() can't be used on lwip_cyclic_timers

Add const int variable containing number of array elements
This commit is contained in:
Dirk Ziegelmeier 2017-06-14 23:05:50 +02:00
parent 7197bf25f0
commit c923d00340
2 changed files with 4 additions and 1 deletions

View File

@ -105,6 +105,7 @@ const struct lwip_cyclic_timer lwip_cyclic_timers[] = {
#endif /* LWIP_IPV6_MLD */
#endif /* LWIP_IPV6 */
};
const int lwip_num_cyclic_timers = LWIP_ARRAYSIZE(lwip_cyclic_timers);
#if LWIP_TIMERS && !LWIP_TIMERS_CUSTOM

View File

@ -71,8 +71,10 @@ struct lwip_cyclic_timer {
};
/** This array contains all stack-internal cyclic timers. To get the number of
* timers, use LWIP_ARRAYSIZE() */
* timers, use lwip_num_cyclic_timers */
extern const struct lwip_cyclic_timer lwip_cyclic_timers[];
/** Array size of lwip_cyclic_timers[] */
extern const int lwip_num_cyclic_timers;
#if LWIP_TIMERS