camerauis/cameraxui/cxengine/inc/api/cxutils.h
changeset 48 42ba2d16bf40
parent 19 d9aefe59d544
child 60 a289dde0a1d6
--- a/camerauis/cameraxui/cxengine/inc/api/cxutils.h	Tue Jul 06 14:04:02 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxutils.h	Wed Aug 18 09:37:18 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -25,38 +25,53 @@
     #define QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION QT_TRAP_THROWING
 #endif
 
-//! @todo change back when we can use udeb again 
-//#ifdef _DEBUG
-#if 1
+
+// Traces enabled only in debug builds.
+// These can heavily affect the performance.
+#ifdef _DEBUG
 
     #include <QDebug>       // Qt Debug
+#ifdef Q_OS_SYMBIAN
     #include <e32debug.h>   // Symbian Debug
+#endif // Q_OS_SYMBIAN
 
-    // engine specific debug macros
     #define CX_DEBUG(msg)                   qDebug msg;
-    #define CX_DEBUG_SYMBIAN(msg)           RDebug::Print msg;
     #define CX_DEBUG_ENTER_FUNCTION()       qDebug("%s => ", __PRETTY_FUNCTION__);
     #define CX_DEBUG_IN_FUNCTION()          qDebug("%s =><= ", __PRETTY_FUNCTION__);
     #define CX_DEBUG_EXIT_FUNCTION()        qDebug("%s <= ", __PRETTY_FUNCTION__);
+#ifdef Q_OS_SYMBIAN
+    #define CX_DEBUG_SYMBIAN(msg)           RDebug::Print msg;
     #define CX_DEBUG_ASSERT(x)              if( !(x) ) {\
                                                 qDebug("%s:%d, ASSERT FAIL [%s]", __FILE__, __LINE__, #x); \
                                                 ASSERT(x); \
                                             }
+#else // !Q_OS_SYMBIAN
+    #define CX_DEBUG_SYMBIAN(msg)           qDebug()<< msg;
+    #define CX_DEBUG_ASSERT(x)              if( !(x) ) {\
+                                                qDebug("%s:%d, ASSERT FAIL [%s]", __FILE__, __LINE__, #x); \
+                                                Q_ASSERT(x); \
+                                            }
+    #define OstTrace0(x,y,z)
+
+#endif // Q_OS_SYMBIAN
     #define CX_ASSERT_ALWAYS(x)             CX_DEBUG_ASSERT(x)
 
 #else // !_DEBUG
 
-    // engine specific debug macros
     #define CX_DEBUG(msg)
     #define CX_DEBUG_SYMBIAN(msg)
     #define CX_DEBUG_ENTER_FUNCTION()
     #define CX_DEBUG_IN_FUNCTION()
     #define CX_DEBUG_EXIT_FUNCTION()
     #define CX_DEBUG_ASSERT(x)
+
+#ifdef Q_OS_SYMBIAN
     #define CX_ASSERT_ALWAYS(x)             ASSERT(x)
+#else // !Q_OS_SYMBIAN
+    #define CX_ASSERT_ALWAYS(x)             Q_ASSERT(x)
+    #define OstTrace0(x,y,z)    
+#endif // Q_OS_SYMBIAN
 
 #endif // _DEBUG
 
-
-
 #endif // CXUTILS_H