Added ARRAY_SIZE(array) macro.

This commit is contained in:
Lasse Collin 2008-01-16 14:31:44 +02:00
parent 9bc33a54cb
commit 19389f2b82
1 changed files with 4 additions and 0 deletions

View File

@ -154,4 +154,8 @@ typedef unsigned char _Bool;
# define MAX(x, y) ((x) > (y) ? (x) : (y)) # define MAX(x, y) ((x) > (y) ? (x) : (y))
#endif #endif
#ifndef ARRAY_SIZE
# define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
#endif
#endif #endif