summaryrefslogtreecommitdiffstats
path: root/sbe/sbefw/assert.h
blob: e7e128a236bb00c75d4eb1b6758f862beab5a117 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 *  @file assert.h
 *
 *  @brief This file contains the assert macro for SBE
 */
#ifndef SBE_ASSERT_H
#define SBE_ASSERT_H
#include "sbetrace.H"
#include "sbeutil.H"

//@TODO via RTC 129166
//inject exception to halt SBE. Also see if we can use some
//PK kernel API.
#ifndef NDEBUG
#define assert(expr) \
    if( !(expr ))  \
    {  \
        SBE_ERROR("assertion failed: "#expr); \
        PK_PANIC(SBE::PANIC_ASSERT); \
    } \

#else
#define assert(expr)
#endif  //NDEBUG

#endif // SBE_ASSERT_H
OpenPOWER on IntegriCloud