From: Francis Deslauriers Date: Mon, 20 Aug 2018 17:23:28 +0000 (-0400) Subject: Silence macro redefinition warnings on macOS X-Git-Tag: v2.11.0-rc1~64 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d575a7f8b451189ba011444a886aa1147f419f4d;p=lttng-tools.git Silence macro redefinition warnings on macOS Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau --- 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) /**