src/utils.h

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