blob: ac26bb6bf56aff45248ff8611702407948aa8cba [file] [log] [blame]
Wolfgang Denkba94a1b2006-05-30 15:56:48 +02001/*
2 * @file IxOsalAssert.h
Wolfgang Denk53677ef2008-05-20 16:00:29 +02003 * @author Intel Corporation
Wolfgang Denkba94a1b2006-05-30 15:56:48 +02004 * @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 Denkcb3761e2013-07-28 22:12:47 +020018 * SPDX-License-Identifier: BSD-3-Clause
Wolfgang Denkba94a1b2006-05-30 15:56:48 +020019 * @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 Denkd9455272006-05-30 15:58:20 +020039#define IX_OSAL_ASSERT(c) IX_OSAL_OS_ASSERT(c)
Wolfgang Denkba94a1b2006-05-30 15:56:48 +020040
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 { \
49if (!(c)) ixOsalLog (IX_OSAL_LOG_LVL_MESSAGE, IX_OSAL_LOG_DEV_STDOUT, str, \
500, 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 */