|
1 /* |
|
2 * Copyright (c) 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 the License "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 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __P2PUSERAPITRACE_H_ |
|
21 #define __P2PUSERAPITRACE_H_ |
|
22 |
|
23 // CONSTANTS |
|
24 _LIT( KP2PUserApiPanic, "P2P User Panic:" ); |
|
25 |
|
26 // MACROS |
|
27 // Panics given due to wrong usage of ISC API. |
|
28 enum TIsaAccessUserApiPanics |
|
29 { |
|
30 EIADChannelNumberOutofRange = 0x01, |
|
31 EIADChannelNotOpen, |
|
32 EIADWrongCustomFunction, |
|
33 EIADCloseFailed, |
|
34 EIADDriverLoadFailed, |
|
35 EIADChannelCreationFailed, |
|
36 }; |
|
37 |
|
38 // INCLUDES |
|
39 #include <e32svr.h> // For RDebug |
|
40 #include <e32std.h> |
|
41 #define _T( a ) _L( a ) |
|
42 #define __TRACE_PRINTF( a ) RDebug::Print a |
|
43 |
|
44 #ifdef _DEBUG |
|
45 #ifdef COMPONENT_TRACE_FLAG |
|
46 #define C_TRACE( a ) __TRACE_PRINTF( a ) |
|
47 #else |
|
48 #define C_TRACE( a ) |
|
49 #endif // COMPONENT_TRACE_FLAG |
|
50 #else |
|
51 #define C_TRACE( a ) |
|
52 #endif // _DEBUG |
|
53 // |
|
54 // Resets are made both in UDEB and UREL (traces only in udeb) |
|
55 #ifdef __WINS__ |
|
56 #define ASSERT_PANIC_ALWAYS(a,b) if(!(a)){User::Panic( KP2PUserApiPanic, b);}; |
|
57 #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__) ) |
|
58 #define TRACE_ASSERT_ALWAYS_COND(a)if(!(a)){ __TRACE_PRINTF( (_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__) );} |
|
59 #else |
|
60 #define ASSERT_PANIC_ALWAYS(a,b) if(!(a)){User::Panic( KP2PUserApiPanic, b);}; |
|
61 #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file=%s, line=%d, compiled=%s %s "),__FILE__, __LINE__, __DATE__, __TIME__) ) |
|
62 #define TRACE_ASSERT_ALWAYS_COND(a)if(!(a)) {__TRACE_PRINTF( (_L("Assertion failed: file=%s, line=%d, compiled=%s %s "),__FILE__, __LINE__, __DATE__, __TIME__) );} |
|
63 #endif |
|
64 |
|
65 // Trace asserts activated also in UREL |
|
66 // define assertions |
|
67 #ifdef __WINS__ |
|
68 #define TRACE_ASSERT(a) if (!(a)) {__TRACE_PRINTF((_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__));} |
|
69 #else |
|
70 #define TRACE_ASSERT(a) if (!(a)) {__TRACE_PRINTF((_L("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__ __TIME__""),__LINE__ ));} |
|
71 #endif //__WINS__ |
|
72 |
|
73 #endif // __P2PUSERAPITRACE_H_ |
|
74 |
|
75 // End of File |