mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-15 09:25:22 +00:00
Define there options for runtime error handling: - assert on all errors (ASSERT_ON_ERRORS) - no runtime checks (no asserts, no runtime error handling) (NO_RUNTIME_CHECKS) - full runtime error handling (the default) (RUNTIME_ERROR_CHECKS) Signed-off-by: Anas Nashif <anas.nashif@intel.com>
27 lines
453 B
C
27 lines
453 B
C
/*
|
|
* Copyright (c) 2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
|
|
#ifndef ZEPHYR_INCLUDE_SYS_CHECK_H_
|
|
#define ZEPHYR_INCLUDE_SYS_CHECK_H_
|
|
|
|
#include <sys/__assert.h>
|
|
|
|
#if defined(CONFIG_ASSERT_ON_ERRORS)
|
|
#define CHECKIF(expr) \
|
|
__ASSERT_NO_MSG(!(expr)); \
|
|
if (0)
|
|
#elif defined(CONFIG_NO_RUNTIME_CHECKS)
|
|
#define CHECKIF(...) \
|
|
if (0)
|
|
#else
|
|
#define CHECKIF(expr) \
|
|
if (expr)
|
|
#endif
|
|
|
|
|
|
#endif /* ZEPHYR_INCLUDE_SYS_CHECK_H_ */
|