diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-11-23 18:35:58 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-11-23 18:35:58 -0500 |
commit | 3c5938e7d4064541eab1d5e02de61237e05a1699 (patch) | |
tree | c9fd7ccb738d02689d532474028e6c1a831bfdce /paxinc.h | |
parent | dumpelf: clean up types all over the place (diff) | |
download | pax-utils-3c5938e7d4064541eab1d5e02de61237e05a1699.tar.gz pax-utils-3c5938e7d4064541eab1d5e02de61237e05a1699.tar.bz2 pax-utils-3c5938e7d4064541eab1d5e02de61237e05a1699.zip |
dumpelf: add support for dumping notes
Diffstat (limited to 'paxinc.h')
-rw-r--r-- | paxinc.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -102,6 +102,12 @@ const char *strfileperms(const char *fname); } else { errf("ESET failed :( (size(Y) == %i)", (int)sizeof(Y)); } \ } while (0) +/* alignment helpers */ +#define ALIGN_DOWN(base, size) ((base) & -((__typeof__(base)) (size))) +#define ALIGN_UP(base, size) ALIGN_DOWN((base) + (size) - 1, (size)) +#define PTR_ALIGN_DOWN(base, size) ((__typeof__(base))ALIGN_DOWN((uintptr_t)(base), (size))) +#define PTR_ALIGN_UP(base, size) ((__typeof__(base))ALIGN_UP ((uintptr_t)(base), (size))) + /* helper functions for showing errors */ extern const char *NORM, *RED, *YELLOW; void color_init(bool disable); |