First public contribution.
1 // Copyright (c) 2008-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 // This is the preinclude file for the RVCT compiler. It contains all the compiler
15 // specific definitions required by the Symbian OS source code.
25 #if defined(__PRODUCT_INCLUDE__)
26 #include __PRODUCT_INCLUDE__
29 // stuff from e32def.h
30 #define __NO_CLASS_CONSTS__
31 #define __NORETURN__ __declspec(noreturn)
32 #define __NORETURN_TERMINATOR()
35 #define IMPORT_C __declspec(dllimport)
39 #define EXPORT_C __declspec(dllexport)
43 #if __ARMCC_VERSION < 310000
44 #define IMPORT_D __declspec(dllexport)
46 #define IMPORT_D __declspec(dllimport)
51 #define EXPORT_D __declspec(dllexport)
54 // Used by some of RVCT's header files. For more information, see "C Library ABI for
55 // the ARM Architecture."
56 #define _AEABI_PORTABILITY_LEVEL 0
59 Declares a class as being non-sharable.
61 If a class is non-sharable, then a class implemented in another DLL cannot
62 derive (inherit) from that class.
64 Declaring a class as non-sharable prevents the compiler from exporting compiler
65 implementation-specific symbols, i.e. run-time type-information and virtual
66 tables. This prevents classes in other DLLs from being able to derive from it.
69 - if a class is marked as non-sharable, then Symbian OS requires all
70 classes that are derived from that class, and which are also implemented in the same DLL,
71 to be declared as non-sharable.
72 - by default, a class is sharable.
74 The following code fragment shows how a non-sharable class is declared.
77 NONSHARABLE_CLASS(CMyClass) : public CBase
86 @param x The name of the class to be declared as non-sharable.
88 #define NONSHARABLE_CLASS(x) class __declspec(notshared) x
89 #define NONSHARABLE_STRUCT(x) struct __declspec(notshared) x
91 #define __NO_THROW throw ()
92 #define __THROW(t) throw (t)
94 #define TEMPLATE_SPECIALIZATION template<>
97 #define __int64 long long
100 #define __VALUE_IN_REGS__ __value_in_regs
102 #define I64LIT(x) x##LL
103 #define UI64LIT(x) x##ULL
105 #define __SOFTFP __softfp
107 // __TText from e32cmn.h also e32des16.h
109 typedef wchar_t __TText; // Only ISO C++ has wchar_t as a primitive type
110 #define __wchar_t_defined
112 typedef unsigned short __TText;
114 #define __TText_defined
116 // __NAKED__ from cpudefs.h
117 #define __NAKED__ __asm
118 #define ____ONLY_USE_NAKED_IN_CIA____ __asm
120 // Int64 and Uint64 from nkern\nklib.h
121 typedef long long Int64;
122 typedef unsigned long long Uint64;
124 // Here are RVCT's definitions for stdarg.h
125 // These should be used by e.g. stdlib
128 namespace std { extern "C" {
131 typedef struct __va_list { void *__ap; } va_list;
135 using ::std::va_list;
138 #define va_start(ap, parmN) __va_start(ap, parmN)
139 #define va_arg(ap, type) __va_arg(ap, type)
140 #define va_end(ap) ((void)0)
142 // These are for Symbian OS C++ code
143 #define VA_START(ap,pn) va_start(ap, pn)
144 #define VA_ARG(ap,type) va_arg(ap,type)
145 #define VA_END(ap) va_end(ap)
146 #define VA_LIST va_list
147 #define __VA_LIST_defined
148 // This should prevent /stdlib/linc/stdarg.h from doing damage.
151 // now deal with stdarg_e.h
152 typedef va_list __e32_va_list;
155 // This is an EABI compliant compiler
160 // These are hopefully temporary.
162 // defining this means we don't get __NAKED__ ctors
163 #ifndef __EABI_CTORS__
164 #define __EABI_CTORS__
167 #ifndef __SYMBIAN_STDCPP_SUPPORT__
172 // Support for throwing exceptions through embedded assembler Should only be
175 #define __EH_FRAME_ADDRESS(reg,offset) FRAME ADDRESS reg, offset
176 #define __EH_FRAME_PUSH2(reg1,reg2) FRAME PUSH {reg1, reg2}
177 #define __EH_FRAME_SAVE1(reg,offset) FRAME SAVE {reg}, offset