From a6328070d92c75396c941a6962f4553ee7f3f9c1 Mon Sep 17 00:00:00 2001 From: Marq Schneider Date: Fri, 13 Aug 2010 10:55:14 -0500 Subject: Added ARRAY_COUNT() macro to get number of elements in const arrays. --- misc/utils.h | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 misc/utils.h (limited to 'misc/utils.h') diff --git a/misc/utils.h b/misc/utils.h new file mode 100644 index 0000000..d996779 --- /dev/null +++ b/misc/utils.h @@ -0,0 +1,7 @@ +#ifndef BTPD_UTILS_H +#define BTPD_UTILS_H + +/* get the number of elements in a static table */ +#define ARRAY_COUNT(array) (sizeof(array) / sizeof(array[0])) + +#endif -- cgit 1.4.1