diff options
| author | Marq Schneider <queueRAM@gmail.com> | 2010-08-13 10:55:14 -0500 |
|---|---|---|
| committer | Marq Schneider <queueRAM@gmail.com> | 2010-08-13 10:55:14 -0500 |
| commit | a6328070d92c75396c941a6962f4553ee7f3f9c1 (patch) | |
| tree | 4eae52c83f16f9b82632c894a4e4916cc772ba0d /misc | |
| parent | 9667cf0694245ead296a4d79a1579448a625fd60 (diff) | |
| download | btpd-a6328070d92c75396c941a6962f4553ee7f3f9c1.tar.gz btpd-a6328070d92c75396c941a6962f4553ee7f3f9c1.zip | |
Added ARRAY_COUNT() macro to get number of elements in const arrays.
Diffstat (limited to 'misc')
| -rw-r--r-- | misc/utils.h | 7 |
1 files changed, 7 insertions, 0 deletions
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 |