connectivitylayer/isce/isiapi_dll/inc/isiiftrace.h
changeset 0 63b37f68c1ce
equal deleted inserted replaced
-1:000000000000 0:63b37f68c1ce
       
     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 __ISIUSERAPITRACE_H_
       
    21 #define __ISIUSERAPITRACE_H_
       
    22 
       
    23 // CONSTANTS
       
    24 _LIT( KISIUserApiPanic, "ISI User Panic:" );
       
    25 
       
    26 // MACROS
       
    27 // Panics given due to wrong usage of ISI API.
       
    28 enum TISIUserApiPanics
       
    29     {
       
    30     EISIChannelNumberOutOfRange = 0x01,
       
    31     EISIChannelNotOpen,
       
    32     EISIMemAllocFailure,
       
    33     EISICloseFailed,
       
    34     EISIDriverLoadFailed,
       
    35     EISIChannelCreationFailed,
       
    36     };
       
    37 
       
    38 
       
    39 // INCLUDES
       
    40 #include <e32svr.h>    // For RDebug
       
    41 #include <e32std.h>
       
    42 #define _T( a ) _L( a )
       
    43 #define __TRACE_PRINTF( a ) RDebug::Print a
       
    44 
       
    45 #ifdef _DEBUG
       
    46     #ifdef COMPONENT_TRACE_FLAG
       
    47         #define C_TRACE( a ) __TRACE_PRINTF( a )
       
    48     #else
       
    49         #define C_TRACE( a ) 
       
    50     #endif // COMPONENT_TRACE_FLAG
       
    51 #else
       
    52     #define C_TRACE( a )
       
    53 #endif // _DEBUG
       
    54 //
       
    55 // Resets are made both in UDEB and UREL (traces only in udeb)
       
    56 #ifdef __WINS__
       
    57 #define ASSERT_PANIC_ALWAYS(a,b) if(!(a)){User::Panic( KISIUserApiPanic, b);};
       
    58     #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__) )
       
    59     #define TRACE_ASSERT_ALWAYS_COND(a)if(!(a)){ __TRACE_PRINTF( (_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__) );}
       
    60 #else
       
    61     #define ASSERT_PANIC_ALWAYS(a,b) if(!(a)){User::Panic( KISIUserApiPanic, b);}; 
       
    62     #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file=%s, line=%d, compiled=%s %s "),__FILE__, __LINE__, __DATE__, __TIME__) )
       
    63     #define TRACE_ASSERT_ALWAYS_COND(a)if(!(a)) {__TRACE_PRINTF( (_L("Assertion failed: file=%s, line=%d, compiled=%s %s "),__FILE__, __LINE__, __DATE__, __TIME__) );}
       
    64 #endif
       
    65 
       
    66 // Trace asserts activated also in UREL
       
    67 // define assertions
       
    68 #ifdef __WINS__
       
    69 #define TRACE_ASSERT(a) if (!(a)) {__TRACE_PRINTF((_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__));}
       
    70 #else
       
    71 #define TRACE_ASSERT(a) if (!(a)) {__TRACE_PRINTF((_L("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__ __TIME__""),__LINE__ ));}
       
    72 #endif  //__WINS__
       
    73 
       
    74 #endif // __ISIUSERAPITRACE_H_
       
    75 
       
    76 //  End of File