From d575a7f8b451189ba011444a886aa1147f419f4d Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Mon, 20 Aug 2018 13:23:28 -0400 Subject: [PATCH] Silence macro redefinition warnings on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau --- src/common/align.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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) /** -- 2.34.1