TP_13 exo2: Finish the implementation of a basic tic-tac-toe game.
[TD_C.git] / TP_13 / exo1 / lib / macros.h
index ab500dfb25d34e25e6e17272e317505f0a887886..f485a9afabfb96f282b9cccd17ffe55ed49af65a 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 */
+#endif /* MACROS_H */