diff --git a/include/common/compiler.h b/include/common/compiler.h index ada79f293..eaf545b26 100644 --- a/include/common/compiler.h +++ b/include/common/compiler.h @@ -57,6 +57,10 @@ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) +#ifndef FIELD_SIZEOF +# define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) +#endif + #define __round_mask(x, y) ((__typeof__(x))((y) - 1)) #define round_up(x, y) ((((x) - 1) | __round_mask(x, y)) + 1) #define round_down(x, y) ((x) & ~__round_mask(x, y))