Update contrib.
1 // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32\common\common.h
18 #ifndef __E32_COMMON_H__
19 #define __E32_COMMON_H__
21 #ifdef __KERNEL_MODE__
36 GLREF_C void Panic(TCdtPanic aPanic);
37 GLDEF_C void PanicBadArrayIndex();
38 GLREF_C TInt __DoConvertNum(TUint, TRadix, TUint, TUint8*&);
39 GLREF_C TInt __DoConvertNum(Uint64, TRadix, TUint, TUint8*&);
41 #ifdef __KERNEL_MODE__
42 GLREF_C void KernHeapFault(TCdtPanic aPanic);
43 GLREF_C void KHeapCheckThreadState();
44 TInt StringLength(const TUint16* aPtr);
45 TInt StringLength(const TUint8* aPtr);
47 #define STD_CLASS Kern
48 #define STRING_LENGTH(s) StringLength(s)
49 #define STRING_LENGTH_16(s) StringLength(s)
50 #define PANIC_CURRENT_THREAD(c,r) Kern::PanicCurrentThread(c, r)
51 #define __KERNEL_CHECK_RADIX(r) __ASSERT_ALWAYS(((r)==EDecimal)||((r)==EHex),Panic(EInvalidRadix))
52 #define APPEND_BUF_SIZE 10
53 #define APPEND_BUF_SIZE_64 20
54 #define HEAP_PANIC(r) RHeapK::Fault(r)
55 #define GET_PAGE_SIZE(x) x = M::PageSizeInBytes()
56 #define DIVISION_BY_ZERO() FAULT()
59 #define __CHECK_THREAD_STATE RHeapK::CheckThreadState()
61 #define __CHECK_THREAD_STATE
66 #define STD_CLASS User
67 #define STRING_LENGTH(s) User::StringLength(s)
68 #define STRING_LENGTH_16(s) User::StringLength(s)
69 #define PANIC_CURRENT_THREAD(c,r) User::Panic(c, r)
70 #define MEM_COMPARE_16 Mem::Compare
71 #define __KERNEL_CHECK_RADIX(r)
72 #define APPEND_BUF_SIZE 32
73 #define APPEND_BUF_SIZE_64 64
74 #define HEAP_PANIC(r) Panic(r)
75 #define GET_PAGE_SIZE(x) UserHal::PageSizeInBytes(x)
76 #define DIVISION_BY_ZERO() User::RaiseException(EExcIntegerDivideByZero)
77 #define __CHECK_THREAD_STATE
79 #endif // __KERNEL_MODE__