forked from cory/tildefriends
cleanup: Consolidate countof macros.
This commit is contained in:
@ -150,4 +150,11 @@ const char* tf_util_function_to_string(void* function);
|
||||
_a > _b ? _b : _a; \
|
||||
})
|
||||
|
||||
/**
|
||||
** Get the number of elements in an array.
|
||||
** @param a The array.
|
||||
** @return The number of array elements.
|
||||
*/
|
||||
#define tf_countof(a) ((int)(sizeof((a)) / sizeof(*(a))))
|
||||
|
||||
/** @} */
|
||||
|
Reference in New Issue
Block a user