improved preprocessor macro to determine array size
[rocksndiamonds.git] / src / libgame / types.h
index 1278a553a6418c85f6ee2f1bde885f78ca8594fa..94fd58b645476cd690c5c17d17e5ac675b0fd410 100644 (file)
@@ -64,8 +64,7 @@ typedef unsigned char byte;
 #define EVEN(a)                (((a) & 1) == 0)
 #endif
 
-#define SIZEOF_ARRAY(array, type)      (sizeof(array) / sizeof(type))
-#define SIZEOF_ARRAY_INT(array)                SIZEOF_ARRAY(array, int)
+#define ARRAY_SIZE(array)              (sizeof(array) / sizeof(array[0]))
 
 
 struct ListNode