diff -r 000000000000 -r 63b37f68c1ce connectivitylayer/isce/p2papi_dll/inc/p2puserapitrace.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectivitylayer/isce/p2papi_dll/inc/p2puserapitrace.h Fri Nov 06 17:28:23 2009 +0000 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef __P2PUSERAPITRACE_H_ +#define __P2PUSERAPITRACE_H_ + +// CONSTANTS +_LIT( KP2PUserApiPanic, "P2P User Panic:" ); + +// MACROS +// Panics given due to wrong usage of ISC API. +enum TIsaAccessUserApiPanics + { + EIADChannelNumberOutofRange = 0x01, + EIADChannelNotOpen, + EIADWrongCustomFunction, + EIADCloseFailed, + EIADDriverLoadFailed, + EIADChannelCreationFailed, + }; + +// INCLUDES +#include // For RDebug +#include +#define _T( a ) _L( a ) +#define __TRACE_PRINTF( a ) RDebug::Print a + +#ifdef _DEBUG + #ifdef COMPONENT_TRACE_FLAG + #define C_TRACE( a ) __TRACE_PRINTF( a ) + #else + #define C_TRACE( a ) + #endif // COMPONENT_TRACE_FLAG +#else + #define C_TRACE( a ) +#endif // _DEBUG +// +// Resets are made both in UDEB and UREL (traces only in udeb) +#ifdef __WINS__ +#define ASSERT_PANIC_ALWAYS(a,b) if(!(a)){User::Panic( KP2PUserApiPanic, b);}; + #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__) ) + #define TRACE_ASSERT_ALWAYS_COND(a)if(!(a)){ __TRACE_PRINTF( (_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__) );} +#else + #define ASSERT_PANIC_ALWAYS(a,b) if(!(a)){User::Panic( KP2PUserApiPanic, b);}; + #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file=%s, line=%d, compiled=%s %s "),__FILE__, __LINE__, __DATE__, __TIME__) ) + #define TRACE_ASSERT_ALWAYS_COND(a)if(!(a)) {__TRACE_PRINTF( (_L("Assertion failed: file=%s, line=%d, compiled=%s %s "),__FILE__, __LINE__, __DATE__, __TIME__) );} +#endif + +// Trace asserts activated also in UREL +// define assertions +#ifdef __WINS__ +#define TRACE_ASSERT(a) if (!(a)) {__TRACE_PRINTF((_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__));} +#else +#define TRACE_ASSERT(a) if (!(a)) {__TRACE_PRINTF((_L("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__ __TIME__""),__LINE__ ));} +#endif //__WINS__ + +#endif // __P2PUSERAPITRACE_H_ + +// End of File