equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Defines the standard C assert macro and an asserte macro |
|
16 * to show the source file and line in a message window. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef __ASSERT_H__ |
|
23 #define __ASSERT_H__ |
|
24 |
|
25 // asserte |
|
26 // Extend assert to raise a panic that features the source file and |
|
27 // line number that caused the assert. |
|
28 #include <e32std.h> |
|
29 extern void AssertE( TPtrC8 _file, TInt _line ); |
|
30 #define asserte(x) if(!(x)) { AssertE( (TPtrC8(reinterpret_cast<const TText8*>(__FILE__))), __LINE__); } |
|
31 |
|
32 // assert |
|
33 // Exit the program and show the message "Assert Failed". |
|
34 #define assert(x) __ASSERT_ALWAYS((x),User::Panic(_L("Assert Failed"),0)) |
|
35 |
|
36 #endif //__ASSERT_H__ |