diff options
Diffstat (limited to 'payloads/libpayload/include/stddef.h')
-rw-r--r-- | payloads/libpayload/include/stddef.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/payloads/libpayload/include/stddef.h b/payloads/libpayload/include/stddef.h index bb2971dd3a..fe455b8a23 100644 --- a/payloads/libpayload/include/stddef.h +++ b/payloads/libpayload/include/stddef.h @@ -16,7 +16,15 @@ typedef __SIZE_TYPE__ ssize_t; #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER) #define member_size(TYPE, MEMBER) (sizeof(((TYPE *) 0)->MEMBER)) +#define check_member(structure, member, offset) _Static_assert( \ + offsetof(struct structure, member) == offset, \ + "`struct " #structure "` offset for `" #member "` is not " #offset) + /* Standard units. */ #define KiB (1<<10) #define MiB (1<<20) #define GiB (1<<30) + +#define KHz (1000) +#define MHz (1000*KHz) +#define GHz (1000*MHz) |