cleanup: Consolidate countof macros.

This commit is contained in:
2024-11-13 20:22:42 -05:00
parent 5bdf970c10
commit 53e75d8209
10 changed files with 26 additions and 48 deletions

View File

@ -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))))
/** @} */