TP 13 exo1: Add more library functions
[TD_C.git] / TP_13 / exo1 / lib / macros.h
index ab500dfb25d34e25e6e17272e317505f0a887886..4b39cf49e3ad8c88b4fae4414f8e33c0f1368916 100644 (file)
 #ifndef MACROS_H
 #define MACROS_H
 
+#include <stdlib.h>
+
 /* definition to expand macro then apply to pragma message */
 #define VALUE_TO_STRING(x) #x
 #define VALUE(x) VALUE_TO_STRING(x)
 #define VAR_NAME_VALUE(var) #var "=" VALUE(var)
 
-#define ARRAY_SIZE(arr) ({typeof (arr) arr ## _is_a_pointer __attribute__((unused)) = {}; \
-                          sizeof(arr) / sizeof(arr[0]);})
+/* FIXME: ensure we manipulate real array */
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
 
 #endif /*  MACROS_H */