Update contrib.
1 // Copyright (c) 2002-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 "ARM EABI LICENCE.txt"
5 // which accompanies this distribution, and is available
6 // in kernel/eka/compsupp.
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32\compsupp\rvct2_1\rvct2_1.h
15 // This is the preinclude file for the rvct 2.1 compiler
16 // It contains all the compiler specific definitions required by the SOS source
26 #ifdef __ARMCC_VERSION
27 #if (__ARMCC_VERSION < 210000 || __ARMCC_VERSION >= 220000)
28 #error This instantiation of the build requires use of RVCT 2.1
32 #if defined(__PRODUCT_INCLUDE__)
33 #include __PRODUCT_INCLUDE__
37 // stuff from e32def.h
38 #define __NO_CLASS_CONSTS__
39 #define __NORETURN__ __declspec(noreturn)
40 #define __NORETURN_TERMINATOR()
41 #define IMPORT_C __declspec(dllimport)
42 #define EXPORT_C __declspec(dllexport)
48 Declares a class as being non-sharable.
50 If a class is non-sharable, then a class implemented in another DLL cannot
51 derive (inherit) from that class.
53 Declaring a class as non-sharable prevents the compiler from exporting compiler
54 implementation-specific symbols, i.e. run-time type-information and virtual
55 tables. This prevents classes in other DLLs from being able to derive from it.
58 - if a class is marked as non-sharable, then Symbian OS requires all
59 classes that are derived from that class, and which are also implemented in the same DLL,
60 to be declared as non-sharable.
61 - by default, a class is sharable.
63 The following code fragment shows how a non-sharable class is declared.
66 NONSHARABLE_CLASS(CMyClass) : public CBase
75 @param x The name of the class to be declared as non-sharable.
77 #define NONSHARABLE_CLASS(x) class __declspec(notshared) x
78 #define NONSHARABLE_STRUCT(x) struct __declspec(notshared) x
79 #define __NO_THROW throw ()
80 #define __THROW(t) throw (t)
81 #define TEMPLATE_SPECIALIZATION template<>
83 #define __int64 long long
85 #define __VALUE_IN_REGS__ __value_in_regs
86 #define I64LIT(x) x##LL
87 #define UI64LIT(x) x##ULL
88 #define __SOFTFP __softfp
90 // __TText from e32cmn.h also e32des16.h
92 typedef wchar_t __TText; // Only ISO C++ has wchar_t as a primitive type
93 #define __wchar_t_defined
95 typedef unsigned short __TText;
97 #define __TText_defined
99 // __NAKED__ from cpudefs.h
100 #define __NAKED__ __asm
101 #define ____ONLY_USE_NAKED_IN_CIA____ __asm
103 // Int64 and Uint64 from nkern\nklib.h
104 typedef long long Int64;
105 typedef unsigned long long Uint64;
107 // Here are RVCT 2.0's definitions for stdarg.h
108 // These should be used by e.g. stdlib
110 // see if we're using the BETA B compiler
111 #if (__ARMCC_VERSION == 200022)
118 #endif /* __cplusplus */
121 typedef int *va_list[1];
123 typedef struct __va_list { void *__ap; } va_list;
128 } /* namespace std */
130 using ::std::va_list;
133 #define va_start(ap, parmN) __va_start(ap, parmN)
134 #define va_arg(ap, type) __va_arg(ap, type)
135 #define va_end(ap) ((void)0)
137 // These are for Symbian OS C++ code
138 #define VA_START(ap,pn) va_start(ap, pn)
139 #define VA_ARG(ap,type) va_arg(ap,type)
140 #define VA_END(ap) va_end(ap)
141 #define VA_LIST va_list
142 #define __VA_LIST_defined
143 // This should prevent /stdlib/linc/stdarg.h from doing damage.
146 // now deal with stdarg_e.h
147 typedef va_list __e32_va_list;
150 // This is an EABI compliant compiler
155 // these are hopefully temporary
157 // defining this means we don't get __NAKED__ ctors
158 #ifndef __EABI_CTORS__
159 #define __EABI_CTORS__
162 //#define __EARLY_DEBUG__
164 // Deal with operator new issues here
167 struct nothrow_t { };
168 extern const nothrow_t nothrow;
171 IMPORT_C void* operator new(unsigned int aSize) __NO_THROW;
173 IMPORT_C void* operator new[](unsigned int aSize) __NO_THROW;
175 IMPORT_C void* operator new(unsigned int aSize, const std::nothrow_t& aNoThrow) __NO_THROW;
177 IMPORT_C void* operator new[](unsigned int aSize, const std::nothrow_t& aNoThrow) __NO_THROW;
179 IMPORT_C void operator delete(void* aPtr) __NO_THROW;
181 IMPORT_C void operator delete[](void* aPtr) __NO_THROW;
183 IMPORT_C void operator delete(void* aPtr, const std::nothrow_t& aNoThrow) __NO_THROW;
185 IMPORT_C void operator delete[](void* aPtr, const std::nothrow_t& aNoThrow) __NO_THROW;
187 // Support for throwing exceptions through embedded assembler
188 // Should only be needed user side
190 #define __EH_FRAME_ADDRESS(reg,offset) FRAME ADDRESS reg, offset
191 #define __EH_FRAME_PUSH2(reg1,reg2) FRAME PUSH {reg1, reg2}
192 #define __EH_FRAME_SAVE1(reg,offset) FRAME SAVE {reg}, offset