X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Falign.h;h=ed353206d1ad03e3d1286414f604041f80538037;hp=928c5b6c131ec36061662f7624fd74a000a87224;hb=d575a7f8b451189ba011444a886aa1147f419f4d;hpb=9d82c4c2efc657618039baf1b9150f82b388ca96 diff --git a/src/common/align.h b/src/common/align.h index 928c5b6c1..ed353206d 100644 --- a/src/common/align.h +++ b/src/common/align.h @@ -21,13 +21,20 @@ #include #include -#ifndef PAGE_SIZE /* Cygwin limits.h defines its own PAGE_SIZE */ +#ifndef PAGE_SIZE /* Cygwin limits.h defines its own PAGE_SIZE. */ #define PAGE_SIZE sysconf(_SC_PAGE_SIZE) #endif +#ifndef PAGE_MASK /* macOS defines its own PAGE_MASK. */ #define PAGE_MASK (~(PAGE_SIZE - 1)) +#endif + #define __ALIGN_MASK(v, mask) (((v) + (mask)) & ~(mask)) + +#ifndef ALIGN /* macOS defines its own ALIGN. */ #define ALIGN(v, align) __ALIGN_MASK(v, (__typeof__(v)) (align) - 1) +#endif + #define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE) /**