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.
diff --git a/src/coredump/_UCD_internal.h b/src/coredump/_UCD_internal.h
index 8b36729..5e92777 100644
--- a/src/coredump/_UCD_internal.h
+++ b/src/coredump/_UCD_internal.h
@@ -99,4 +99,8 @@
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