TP 13 exo2: Add the code structure and some basic displaying routines for the tic...
[TD_C.git] / TP_13 / exo1 / lib / macros.h
index ab500dfb25d34e25e6e17272e317505f0a887886..3c0ad027e55f85b5acb0e83d8d64676e9e39655e 100644 (file)
@@ -3,7 +3,7 @@
  *
  *       Filename:  macros.h
  *
- *    Description:  
+ *    Description:  Some useful macros 
  *
  *        Version:  1.0
  *        Created:  09/03/2017 15:28:46
 #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 */