diff -r f1fd07aa74c9 -r 59aa7d6e3e0f usbmgmt/usbmgr/host/fdf/production/server/inc/utils.h --- a/usbmgmt/usbmgr/host/fdf/production/server/inc/utils.h Wed Jul 07 14:16:40 2010 +0800 +++ b/usbmgmt/usbmgr/host/fdf/production/server/inc/utils.h Wed Jul 07 15:08:54 2010 +0800 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-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" @@ -37,47 +37,7 @@ #define CLEANUPSTACK_POP2(a, b) CleanupStack::Pop(2); #endif // _DEBUG -// What we want for internal programming errors in a server is a set of macros -// which, to save effort all round, use __LINE__ as the panic code, and a -// file-specific panic category. To make this non-standard pattern as helpful -// to users as possible, we append ' line#' to the category. That means we -// first have to check that the category is 10 characters long or less, so -// that the whole thing is legible to users when it appears on the screen. -template struct ASSERTION_FAILURE; -TEMPLATE_SPECIALIZATION struct ASSERTION_FAILURE{}; -template struct __assertion_test; -#define COMPILE_ASSERT( B ) void __compile_assert(::__assertion_test)>) -// We want a 10-character string (but allow for the NULL terminator). -#define PANICCATEGORY(aaa) COMPILE_ASSERT(sizeof(L##aaa)/2 <= 11); _LIT(KPanicCat, aaa) - -// A handy panic-self macro- the category is KPanicCat with " line#" appended; -// the code is the line number. -#define PANIC_LINENUM \ - { \ - _LIT(KLnNo, " line#"); \ - TBuf cat = KPanicCat(); \ - cat.Append(KLnNo()); \ - _USB_PANIC(cat, __LINE__); \ - } - -// A handy assertion macro that panics with a locally-defined panic category -// and the line number. -#define ASSERT_ALWAYS(a) \ - { \ - if ( !(a) ) \ - { \ - PANIC_LINENUM; \ - } \ - } - -#ifdef _DEBUG -#define ASSERT_DEBUG(a) ASSERT_ALWAYS(a) -#define DEBUG_PANIC_LINENUM PANIC_LINENUM -#else -#define ASSERT_DEBUG(a) -#define DEBUG_PANIC_LINENUM -#endif // _DEBUG // Undefine the e32def.h-defined ASSERT macro to make sure no-one uses it // under the mistaken impression that it's useful. Use our informative one