|
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 "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 #ifndef CXUTILS_H |
|
18 #define CXUTILS_H |
|
19 |
|
20 // This macro changed name between Qt 4.5.2 and Qt 4.6.0. |
|
21 // Make the old name available, if not defined. |
|
22 //! @todo Remove once old environments not used anymore. |
|
23 #include <QGlobalStatic> // Included to get the ifndef working |
|
24 #ifndef QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION |
|
25 #define QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION QT_TRAP_THROWING |
|
26 #endif |
|
27 |
|
28 //! @todo change back when we can use udeb again |
|
29 //#ifdef _DEBUG |
|
30 #if 1 |
|
31 |
|
32 #include <QDebug> // Qt Debug |
|
33 #include <e32debug.h> // Symbian Debug |
|
34 |
|
35 // engine specific debug macros |
|
36 #define CX_DEBUG(msg) qDebug msg; |
|
37 #define CX_DEBUG_SYMBIAN(msg) RDebug::Print msg; |
|
38 #define CX_DEBUG_ENTER_FUNCTION() qDebug("%s => ", __PRETTY_FUNCTION__); |
|
39 #define CX_DEBUG_IN_FUNCTION() qDebug("%s =><= ", __PRETTY_FUNCTION__); |
|
40 #define CX_DEBUG_EXIT_FUNCTION() qDebug("%s <= ", __PRETTY_FUNCTION__); |
|
41 #define CX_DEBUG_ASSERT(x) if( !(x) ) {\ |
|
42 qDebug("%s:%d, ASSERT FAIL [%s]", __FILE__, __LINE__, #x); \ |
|
43 ASSERT(x); \ |
|
44 } |
|
45 #define CX_ASSERT_ALWAYS(x) CX_DEBUG_ASSERT(x) |
|
46 |
|
47 #else // !_DEBUG |
|
48 |
|
49 // engine specific debug macros |
|
50 #define CX_DEBUG(msg) |
|
51 #define CX_DEBUG_SYMBIAN(msg) |
|
52 #define CX_DEBUG_ENTER_FUNCTION() |
|
53 #define CX_DEBUG_IN_FUNCTION() |
|
54 #define CX_DEBUG_EXIT_FUNCTION() |
|
55 #define CX_DEBUG_ASSERT(x) |
|
56 #define CX_ASSERT_ALWAYS(x) ASSERT(x) |
|
57 |
|
58 #endif // _DEBUG |
|
59 |
|
60 |
|
61 |
|
62 #endif // CXUTILS_H |