camerauis/cameraxui/cxengine/inc/api/cxutils.h
changeset 43 0e652f8f1fbd
parent 19 d9aefe59d544
child 45 24fd82631616
--- a/camerauis/cameraxui/cxengine/inc/api/cxutils.h	Thu May 13 21:30:19 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxutils.h	Thu Jul 15 01:55:05 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,28 +25,39 @@
     #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()
@@ -57,6 +68,4 @@
 
 #endif // _DEBUG
 
-
-
 #endif // CXUTILS_H