diff options
author | nagendra modadugu <ngm@google.com> | 2016-05-24 10:47:22 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-05-25 18:51:07 -0700 |
commit | e1dc48480f9ffdf6089efdff44f906d2f1b91b55 (patch) | |
tree | 467fd231b2024920a89cfbd177cc516915cf9621 /include/util.h | |
parent | 840d61282cfae5bbc1fa8625e0264c112a3e3bb7 (diff) | |
download | chrome-ec-e1dc48480f9ffdf6089efdff44f906d2f1b91b55.tar.gz |
CR50: remove dependence of assert.h on util.h
Third party code includes standard system headers,
but may not have include paths configured for the
platform.
Remove the dependency between assert.h and
platform headers util.h, and panic.h.
BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
TEST=make buildall succeeds
Change-Id: Ic8d4dc1944765d2f0f80782afa574d7b8e54eb0f
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/347080
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'include/util.h')
-rw-r--r-- | include/util.h | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/include/util.h b/include/util.h index fd8f5d40c9..e031148e45 100644 --- a/include/util.h +++ b/include/util.h @@ -12,37 +12,9 @@ #include "compile_time_macros.h" #include "panic.h" +#include "builtin/assert.h" /* For ASSERT(). */ #include <stddef.h> -/** - * Trigger a debug exception if the condition - * is not verified at runtime. - */ -#ifdef CONFIG_DEBUG_ASSERT -#ifdef CONFIG_DEBUG_ASSERT_REBOOTS - -#ifdef CONFIG_DEBUG_ASSERT_BRIEF -#define ASSERT(cond) do { \ - if (!(cond)) \ - panic_assert_fail(__FILE__, __LINE__); \ - } while (0) -#else -#define ASSERT(cond) do { \ - if (!(cond)) \ - panic_assert_fail(#cond, __func__, __FILE__, \ - __LINE__); \ - } while (0) -#endif -#else -#define ASSERT(cond) do { \ - if (!(cond)) \ - __asm("bkpt"); \ - } while (0) -#endif -#else -#define ASSERT(cond) -#endif - /* Standard macros / definitions */ #ifndef MAX #define MAX(a, b) \ |