diff --git a/include/common/compiler.h b/include/common/compiler.h index eaf545b26..fc8abcfef 100644 --- a/include/common/compiler.h +++ b/include/common/compiler.h @@ -8,6 +8,7 @@ */ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#define NELEMS_AS_ARRAY(x,y) (sizeof(x) / sizeof((y)[0])) #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) #define ASSIGN_TYPED(a, b) do { (a) = (typeof(a))(b); } while (0)