equal
deleted
inserted
replaced
19 */ |
19 */ |
20 |
20 |
21 #ifndef MTPDEBUG_H |
21 #ifndef MTPDEBUG_H |
22 #define MTPDEBUG_H |
22 #define MTPDEBUG_H |
23 |
23 |
|
24 /* |
|
25 * Todo: keep these macros temporarily, will discard them at last |
|
26 */ |
24 #include <comms-infras/commsdebugutility.h> |
27 #include <comms-infras/commsdebugutility.h> |
25 |
28 |
26 __FLOG_STMT(_LIT8(KMTPSubsystem, "MTP");) |
29 __FLOG_STMT(_LIT8(KMTPSubsystem, "MTP");) |
27 |
30 |
28 #ifdef __FLOG_ACTIVE |
31 #ifdef __FLOG_ACTIVE |
37 } |
40 } |
38 #else |
41 #else |
39 #define __MTP_HEAP_FLOG |
42 #define __MTP_HEAP_FLOG |
40 #endif // __FLOG_ACTIVE |
43 #endif // __FLOG_ACTIVE |
41 |
44 |
|
45 /* |
|
46 * Unlike __FLOG_ACTIVE, every component has its own macro OST_TRACE_COMPILER_IN_USE . |
|
47 * Thus the macro won't be used in this header file. |
|
48 */ |
|
49 #define __MTP_HEAP_OSTTRACE(r) \ |
|
50 { \ |
|
51 TInt allocated; \ |
|
52 TInt largest; \ |
|
53 TInt available(User::Heap().Available(largest)); \ |
|
54 TInt size(User::Heap().Size()); \ |
|
55 User::Heap().AllocSize(allocated); \ |
|
56 r;\ |
|
57 } |
|
58 |
|
59 #define LEAVEIFERROR(err, trace) \ |
|
60 { \ |
|
61 TInt munged_err=(err); \ |
|
62 if (munged_err < 0) \ |
|
63 { \ |
|
64 trace; \ |
|
65 User::Leave(munged_err);\ |
|
66 }\ |
|
67 } |
|
68 |
|
69 #define TRACEPANIC(aReason, trace) \ |
|
70 { \ |
|
71 tp; \ |
|
72 User::Panic(KMyCategory, (aReason)); \ |
|
73 } |
|
74 |
|
75 #if defined(_DEBUG) |
|
76 #define __ASSERT_DEBUG_OST(c,trace,p) if(!c) {trace; p;} |
|
77 #else |
|
78 #define __ASSERT_DEBUG_OST(c,trace,p) |
|
79 #endif |
|
80 |
|
81 #define __ASSERT_ALWAYS_OST(c,trace,p) if(!c) {trace; p;} |
|
82 |
42 #endif // MTPDEBUG_H |
83 #endif // MTPDEBUG_H |