summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-05-09 14:12:17 -0700
committerJulius Werner <jwerner@chromium.org>2019-05-10 21:41:25 +0000
commita73e5a75b1b1ba03e7712d981456974e89a21264 (patch)
tree9bdf15947d9d474e9bdaa3aac4c409e64571ec0a /src/include
parentef7d89cabe658e7f2951112c50853328988cea98 (diff)
assert.h: Undefine ASSERT macro in case vendorcode headers set it
Some edk2 vendorcode headers define an ASSERT macro. They're guarded with an #ifndef ASSERT, but if coreboot's assert.h gets included after that header, we still have a problem. Add code to assert.h to undefine any rogue definitions that may have already been set by vendorcode headers. This is ugly and should only be a stopgap... it would be nice if someone maintaining those vendorcode parts could eventually replace it with a better solution. One option would be to use a "guard header" for every vendorcode header we want to pull into normal coreboot code which would chain-include the vendorcode header and then undefine anything that clashes with coreboot again. Change-Id: Ibf8dc8b2365821e401ce69705df20aa7540aefb2 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/32715 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/assert.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/assert.h b/src/include/assert.h
index 6036635273..4575a29e44 100644
--- a/src/include/assert.h
+++ b/src/include/assert.h
@@ -19,6 +19,12 @@
#include <arch/hlt.h>
#include <console/console.h>
+/* TODO: Fix vendorcode headers to not define macros coreboot uses or to be more
+ properly isolated. */
+#ifdef ASSERT
+#undef ASSERT
+#endif
+
/* GCC and CAR versions */
#define ASSERT(x) { \
if (!(x)) { \