summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2020-11-11 11:06:53 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-11 19:26:15 +0000
commit013740e2ec6e4452602f63bd873f53dfaa6d1edb (patch)
tree75b1f0ee3248f5752348e85771a094c1c682376f
parentc0fd9b31c55a9b7648ebad21c2584e8201b7057f (diff)
downloadchrome-ec-013740e2ec6e4452602f63bd873f53dfaa6d1edb.tar.gz
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 <jettrink@chromium.org> Change-Id: I6d51106f51217279acb2dcf252ee8ac3383f9959 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532684 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--include/ec_commands.h3
1 files changed, 3 insertions, 0 deletions
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__