From: Michael Jeanson Date: Tue, 13 Oct 2020 20:41:00 +0000 (-0400) Subject: port: Silence macro redefinition warnings on FreeBSD X-Git-Url: http://git.efficios.com/?p=deliverable%2Flttng-ust.git;a=commitdiff_plain;h=d63241543f82756a2fcdaeb05db54f77e688024c port: Silence macro redefinition warnings on FreeBSD Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers Change-Id: I32473a65116fd9e4120a852a8cbc5c145e9609f7 --- 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) /**