From 514020fc76a47c8657147f552836f715e782d1f6 Mon Sep 17 00:00:00 2001 From: Yonatan Schachter Date: Fri, 5 Jan 2024 13:14:36 +0200 Subject: [PATCH] common.h: Guard definition of IS_ALIGNED for Zephyr builds common.h defines the IS_ALIGNED macro, which conflicts with a Zephyr macro of the same name. Add guards to define it only if it is not already defined by Zephyr. Signed-off-by: Yonatan Schachter --- src/include/sof/common.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/include/sof/common.h b/src/include/sof/common.h index 6a875f5a90f7..343cda56c741 100644 --- a/src/include/sof/common.h +++ b/src/include/sof/common.h @@ -14,8 +14,14 @@ /* callers must check/use the return value */ #define __must_check __attribute__((warn_unused_result)) +#ifdef __ZEPHYR__ +#include +#endif + /* Align the number to the nearest alignment value */ +#ifndef IS_ALIGNED #define IS_ALIGNED(size, alignment) ((size) % (alignment) == 0) +#endif /* Treat zero as a special case because it wraps around */ #define is_power_of_2(x) ((x) && !((x) & ((x) - 1)))