X-Git-Url: https://git.piment-noir.org/?p=TD_C.git;a=blobdiff_plain;f=TP_13%2Fexo1%2Flib%2Fmacros.h;h=4b39cf49e3ad8c88b4fae4414f8e33c0f1368916;hp=ab500dfb25d34e25e6e17272e317505f0a887886;hb=e40016767464ae5f361e1be20a9bbc6858878e5e;hpb=0139cafd72a74369bf88580c3a533ef923c97586 diff --git a/TP_13/exo1/lib/macros.h b/TP_13/exo1/lib/macros.h index ab500df..4b39cf4 100644 --- a/TP_13/exo1/lib/macros.h +++ b/TP_13/exo1/lib/macros.h @@ -19,12 +19,14 @@ #ifndef MACROS_H #define MACROS_H +#include + /* 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 */