From d63241543f82756a2fcdaeb05db54f77e688024c Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 13 Oct 2020 16:41:00 -0400 Subject: [PATCH] port: Silence macro redefinition warnings on FreeBSD Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers Change-Id: I32473a65116fd9e4120a852a8cbc5c145e9609f7 --- include/lttng/align.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/lttng/align.h b/include/lttng/align.h index ebf03e8d..8f227eb9 100644 --- a/include/lttng/align.h +++ b/include/lttng/align.h @@ -33,9 +33,13 @@ #define PAGE_SIZE sysconf(_SC_PAGE_SIZE) #endif +#ifndef PAGE_MASK /* FreeBSD and macOS defines their own PAGE_MASK. */ #define PAGE_MASK (~(PAGE_SIZE - 1)) +#endif #define __ALIGN_MASK(v, mask) (((v) + (mask)) & ~(mask)) +#ifndef ALIGN /* FreeBSD and macOS defines their 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