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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32\compsupp\rvct2_2\rvct2_2.h
15 // This is the preinclude file for the rvct 2.2 compiler
16 // It contains all the compiler specific definitions required by the SOS source
28 #ifdef __ARMCC_VERSION
29 #if (__ARMCC_VERSION < 220435 || __ARMCC_VERSION >= 230000)
30 #error This instantiation of the build requires use of RVCT 2.2 Build 435 (or later)
34 #if defined(__PRODUCT_INCLUDE__)
35 #include __PRODUCT_INCLUDE__
39 // stuff from e32def.h
40 #define __NO_CLASS_CONSTS__
41 #define __NORETURN__ __declspec(noreturn)
42 #define __NORETURN_TERMINATOR()
44 #define IMPORT_C __declspec(dllimport)
47 #define EXPORT_C __declspec(dllexport)
54 Declares a class as being non-sharable.
56 If a class is non-sharable, then a class implemented in another DLL cannot
57 derive (inherit) from that class.
59 Declaring a class as non-sharable prevents the compiler from exporting compiler
60 implementation-specific symbols, i.e. run-time type-information and virtual
61 tables. This prevents classes in other DLLs from being able to derive from it.
64 - if a class is marked as non-sharable, then Symbian OS requires all
65 classes that are derived from that class, and which are also implemented in the same DLL,
66 to be declared as non-sharable.
67 - by default, a class is sharable.
69 The following code fragment shows how a non-sharable class is declared.
72 NONSHARABLE_CLASS(CMyClass) : public CBase
81 @param x The name of the class to be declared as non-sharable.
83 #define NONSHARABLE_CLASS(x) class __declspec(notshared) x
84 #define NONSHARABLE_STRUCT(x) struct __declspec(notshared) x
85 #define __NO_THROW throw ()
86 #define __THROW(t) throw (t)
87 #define TEMPLATE_SPECIALIZATION template<>
89 #define __int64 long long
91 #define __VALUE_IN_REGS__ __value_in_regs
92 #define I64LIT(x) x##LL
93 #define UI64LIT(x) x##ULL
94 #define __SOFTFP __softfp
96 // __TText from e32cmn.h also e32des16.h
98 typedef wchar_t __TText; // Only ISO C++ has wchar_t as a primitive type
99 #define __wchar_t_defined
101 typedef unsigned short __TText;
103 #define __TText_defined
105 // __NAKED__ from cpudefs.h
106 #define __NAKED__ __asm
107 #define ____ONLY_USE_NAKED_IN_CIA____ __asm
109 // Int64 and Uint64 from nkern\nklib.h
110 typedef long long Int64;
111 typedef unsigned long long Uint64;
113 // Here are RVCT 2.2's definitions for stdarg.h
114 // These should be used by e.g. stdlib
119 #endif /* __cplusplus */
121 typedef struct __va_list { void *__ap; } va_list;
125 } /* namespace std */
127 using ::std::va_list;
130 #define va_start(ap, parmN) __va_start(ap, parmN)
131 #define va_arg(ap, type) __va_arg(ap, type)
132 #define va_end(ap) ((void)0)
134 // These are for Symbian OS C++ code
135 #define VA_START(ap,pn) va_start(ap, pn)
136 #define VA_ARG(ap,type) va_arg(ap,type)
137 #define VA_END(ap) va_end(ap)
138 #define VA_LIST va_list
139 #define __VA_LIST_defined
140 // This should prevent /stdlib/linc/stdarg.h from doing damage.
143 // now deal with stdarg_e.h
144 typedef va_list __e32_va_list;
147 // This is an EABI compliant compiler
152 // these are hopefully temporary
154 // defining this means we don't get __NAKED__ ctors
155 #ifndef __EABI_CTORS__
156 #define __EABI_CTORS__
159 //#define __EARLY_DEBUG__
161 // Deal with operator new issues here
162 #include "../symcpp.h"
165 // Support for throwing exceptions through embedded assembler
166 // Should only be needed user side
168 #define __EH_FRAME_ADDRESS(reg,offset) FRAME ADDRESS reg, offset
169 #define __EH_FRAME_PUSH2(reg1,reg2) FRAME PUSH {reg1, reg2}
170 #define __EH_FRAME_SAVE1(reg,offset) FRAME SAVE {reg}, offset