Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 1 | /* |
| 2 | * @file IxOsalAssert.h |
Wolfgang Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 3 | * @author Intel Corporation |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 4 | * @date 25-08-2004 |
| 5 | * |
| 6 | * @brief description goes here |
| 7 | * |
| 8 | * @par |
| 9 | * IXP400 SW Release version 2.0 |
| 10 | * |
| 11 | * -- Copyright Notice -- |
| 12 | * |
| 13 | * @par |
| 14 | * Copyright 2001-2005, Intel Corporation. |
| 15 | * All rights reserved. |
| 16 | * |
| 17 | * @par |
Wolfgang Denk | cb3761e | 2013-07-28 22:12:47 +0200 | [diff] [blame] | 18 | * SPDX-License-Identifier: BSD-3-Clause |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 19 | * @par |
| 20 | * -- End of Copyright Notice -- |
| 21 | */ |
| 22 | |
| 23 | #ifndef IX_OSAL_ASSERT_H |
| 24 | #define IX_OSAL_ASSERT_H |
| 25 | |
| 26 | /* |
| 27 | * Put the system defined include files required |
| 28 | * @par |
| 29 | * <TAGGED> |
| 30 | */ |
| 31 | |
| 32 | #include "IxOsalOsAssert.h" |
| 33 | |
| 34 | /** |
| 35 | * @brief Assert macro, assert the condition is true. This |
| 36 | * will not be compiled out. |
| 37 | * N.B. will result in a system crash if it is false. |
| 38 | */ |
Wolfgang Denk | d945527 | 2006-05-30 15:58:20 +0200 | [diff] [blame] | 39 | #define IX_OSAL_ASSERT(c) IX_OSAL_OS_ASSERT(c) |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 40 | |
| 41 | |
| 42 | /** |
| 43 | * @brief Ensure macro, ensure the condition is true. |
| 44 | * This will be conditionally compiled out and |
| 45 | * may be used for test purposes. |
| 46 | */ |
| 47 | #ifdef IX_OSAL_ENSURE_ON |
| 48 | #define IX_OSAL_ENSURE(c, str) do { \ |
| 49 | if (!(c)) ixOsalLog (IX_OSAL_LOG_LVL_MESSAGE, IX_OSAL_LOG_DEV_STDOUT, str, \ |
| 50 | 0, 0, 0, 0, 0, 0); } while (0) |
| 51 | |
| 52 | #else |
| 53 | #define IX_OSAL_ENSURE(c, str) |
| 54 | #endif |
| 55 | |
| 56 | |
| 57 | #endif /* IX_OSAL_ASSERT_H */ |