diff options
Diffstat (limited to 'src/include/stddef.h')
-rw-r--r-- | src/include/stddef.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/stddef.h b/src/include/stddef.h index d0dad6209c..137de04405 100644 --- a/src/include/stddef.h +++ b/src/include/stddef.h @@ -28,6 +28,10 @@ typedef unsigned int wint_t; #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#define check_member(structure, member, offset) _Static_assert( \ + offsetof(struct structure, member) == offset, \ + "`struct " #structure "` offset for `" #member "` is not " #offset ) + #ifdef __PRE_RAM__ #define ROMSTAGE_CONST const #else |