mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-21 23:27:39 +01:00
Add helper macros for pointer arithmetics
ALIGN lets you align pointers and STRUCT_MEMBER lets you get structure members at a specific offset. These are useful in general, and will be needed for the coredump notes cleanup work.
This commit is contained in:
parent
b1393b7e63
commit
edcc521a0e
1 changed files with 4 additions and 0 deletions
|
@ -99,4 +99,8 @@ struct UCD_info
|
|||
|
||||
extern coredump_phdr_t * _UCD_get_elf_image(struct UCD_info *ui, unw_word_t ip);
|
||||
|
||||
#define ALIGN(x,a) (((x)+(a)-1UL)&~((a)-1UL))
|
||||
#define STRUCT_MEMBER_P(struct_p, struct_offset) ((void *) ((char*) (struct_p) + (long) (struct_offset)))
|
||||
#define STRUCT_MEMBER(member_type, struct_p, struct_offset) (*(member_type*) STRUCT_MEMBER_P ((struct_p), (struct_offset)))
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue