1.1 --- a/src/utils.h Wed Feb 09 17:11:48 2011 +0000 1.2 +++ b/src/utils.h Wed Feb 09 22:05:42 2011 +0000 1.3 @@ -1,5 +1,7 @@ 1.4 -#ifndef _H_UTILS 1.5 -#define _H_UTILS 1.6 +#ifndef _UTILS_H 1.7 +#define _UTILS_H 1.8 + 1.9 +#include <stdio.h> 1.10 1.11 #ifndef NDEBUG 1.12 /// Log a message to stderr 1.13 @@ -11,4 +13,7 @@ 1.14 #define LOG_IF(cond, x, ...) 1.15 #endif 1.16 1.17 +/// Get the number of elements in an array 1.18 +#define NELEMS(x) (sizeof(x)/sizeof(x[0])) 1.19 + 1.20 #endif // _H_UTILS