Subversion Repositories HelenOS-historic

Rev

Rev 430 | Rev 501 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 430 Rev 471
Line 32... Line 32...
32
#include <panic.h>
32
#include <panic.h>
33
 
33
 
34
 
34
 
35
/** Debugging ASSERT macro
35
/** Debugging ASSERT macro
36
 *
36
 *
37
 * If NDEBUG is not set, the ASSERT() macro
37
 * If CONFIG_DEBUG is set, the ASSERT() macro
38
 * evaluates expr and if it is false raises
38
 * evaluates expr and if it is false raises
39
 * kernel panic.
39
 * kernel panic.
40
 *
40
 *
41
 * @param expr Expression which is expected to be true.
41
 * @param expr Expression which is expected to be true.
42
 *
42
 *
43
 */
43
 */
44
#ifndef NDEBUG
44
#ifdef CONFIG_DEBUG
45
#   define ASSERT(expr) if (!(expr)) { panic("assertion failed (%s)", #expr); }
45
#   define ASSERT(expr) if (!(expr)) { panic("assertion failed (%s)", #expr); }
46
#else
46
#else
47
#   define ASSERT(expr)
47
#   define ASSERT(expr)
48
#endif
48
#endif
49
 
49