X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fmacro.h;h=5619c32e457ba792172fa29badabeb50dbda6f8c;hb=f41925b4e442a34c93ad120ef1426c974a047ed1;hp=70c5fb50a74b9ab49a9eb4823a8fd9e3f4be884f;hpb=7df23077e45e55a6fc15eb99fe2ae439678e37e0;p=elogind.git diff --git a/src/shared/macro.h b/src/shared/macro.h index 70c5fb50a..5619c32e4 100644 --- a/src/shared/macro.h +++ b/src/shared/macro.h @@ -241,6 +241,9 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) { #define PTR_TO_UINT64(p) ((uint64_t) ((uintptr_t) (p))) #define UINT64_TO_PTR(u) ((void *) ((uintptr_t) (u))) +#define PTR_TO_SIZE(p) ((size_t) ((uintptr_t) (p))) +#define SIZE_TO_PTR(u) ((void *) ((uintptr_t) (u))) + #define memzero(x,l) (memset((x), 0, (l))) #define zero(x) (memzero(&(x), sizeof(x)))