mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-03 07:31:54 +00:00
Type checking in SKIP_BACK macro
This commit is contained in:
parent
c70b3198dc
commit
2d7e42cc59
@ -16,7 +16,7 @@
|
|||||||
struct align_probe { char x; long int y; };
|
struct align_probe { char x; long int y; };
|
||||||
|
|
||||||
#define OFFSETOF(s, i) ((size_t) &((s *)0)->i)
|
#define OFFSETOF(s, i) ((size_t) &((s *)0)->i)
|
||||||
#define SKIP_BACK(s, i, p) ((s *)((char *)p - OFFSETOF(s, i)))
|
#define SKIP_BACK(s, i, p) ({ s *_ptr = ((s *)((char *)p - OFFSETOF(s, i))); ASSERT_DIE(&_ptr->i == p); _ptr; })
|
||||||
#define BIRD_ALIGN(s, a) (((s)+a-1)&~(a-1))
|
#define BIRD_ALIGN(s, a) (((s)+a-1)&~(a-1))
|
||||||
#define CPU_STRUCT_ALIGN (sizeof(struct align_probe))
|
#define CPU_STRUCT_ALIGN (sizeof(struct align_probe))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user