From 013740e2ec6e4452602f63bd873f53dfaa6d1edb Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Wed, 11 Nov 2020 11:06:53 -0700 Subject: ec_command: don't assume BUILD_ASSERT is undefined In the scenario where we are not building from platform/ec, we define BUILD_ASSERT to a no-op. We should only do that if the BUILD_ASSERT macro is undefined; otherwise we should just leave the definition. BRANCH=none BUG=none TEST=build EC and zephyr code without issue Signed-off-by: Jett Rink Change-Id: I6d51106f51217279acb2dcf252ee8ac3383f9959 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532684 Commit-Queue: Jack Rosenthal Reviewed-by: Jack Rosenthal --- include/ec_commands.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/ec_commands.h b/include/ec_commands.h index 0feb3dbfd7..190f44f981 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -32,7 +32,10 @@ extern "C" { #include "compile_time_macros.h" #else +/* If BUILD_ASSERT isn't already defined, make it a no-op */ +#ifndef BUILD_ASSERT #define BUILD_ASSERT(_cond) +#endif /* !BUILD_ASSERT */ #endif /* CHROMIUM_EC */ #ifdef __KERNEL__ -- cgit v1.2.1