1 // Copyright (c) 2005-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\gcce\gcce.h
15 // This is the preinclude file for the GCC-E compiler
16 // It contains all the compiler specific definitions required by the SOS source
26 #if defined(__PRODUCT_INCLUDE__)
27 #include __PRODUCT_INCLUDE__
30 // stuff from e32def.h
32 #define __NO_CLASS_CONSTS__
33 #define __NORETURN__ __declspec(noreturn)
34 #define __NORETURN_TERMINATOR()
36 #define IMPORT_C __declspec(dllimport)
37 #define EXPORT_C __declspec(dllexport)
39 #define IMPORT_D __declspec(dllimport)
40 #define EXPORT_D __declspec(dllexport)
46 Declares a class as being non-sharable.
48 If a class is non-sharable, then a class implemented in another DLL cannot
49 derive (inherit) from that class.
51 Declaring a class as non-sharable prevents the compiler from exporting compiler
52 implementation-specific symbols, i.e. run-time type-information and virtual
53 tables. This prevents classes in other DLLs from being able to derive from it.
56 - if a class is marked as non-sharable, then Symbian OS requires all
57 classes that are derived from that class, and which are also implemented in the same DLL,
58 to be declared as non-sharable.
59 - by default, a class is sharable.
61 The following code fragment shows how a non-sharable class is declared.
63 NONSHARABLE_CLASS(CMyClass) : public CBase
72 @param x The name of the class to be declared as non-sharable.
74 #define NONSHARABLE_CLASS(x) class __declspec(notshared) x
76 #define NONSHARABLE_STRUCT(x) struct __declspec(notshared) x
77 #define __NO_THROW throw ()
78 #define __THROW(t) throw (t)
79 #define TEMPLATE_SPECIALIZATION template<>
81 #define __int64 long long
83 #define __VALUE_IN_REGS__
84 #define I64LIT(x) x##LL
85 #define UI64LIT(x) x##ULL
88 // __TText from e32cmn.h also e32des16.h
90 typedef wchar_t __TText; // Only ISO C++ has wchar_t as a primitive type
91 #define __wchar_t_defined
93 typedef unsigned short __TText;
95 #define __TText_defined
97 // __NAKED__ from cpudefs.h
98 #define __NAKED__ __declspec(naked)
99 #define ____ONLY_USE_NAKED_IN_CIA____ __declspec(naked)
100 #define __WEAK__ __attribute__((weak))
102 // Int64 and Uint64 from nkern\nklib.h
103 typedef long long Int64;
104 typedef unsigned long long Uint64;
106 // Here are GCC-E's definitions for stdarg.h
107 // These should be used by e.g. stdlib
110 namespace std { extern "C" {
114 typedef struct __va_list { void *__ap; } va_list;
116 typedef __builtin_va_list va_list;
121 using ::std::va_list;
125 #define va_start(ap, parmN) __builtin_va_start(ap.__ap, parmN)
126 #define va_arg(ap, type) __builtin_va_arg(ap.__ap, type)
127 #define va_end(ap) __builtin_va_end(ap.__ap)
129 #define va_start(ap, parmN) __builtin_va_start(ap, parmN)
130 #define va_arg(ap, type) __builtin_va_arg(ap, type)
131 #define va_end(ap) __builtin_va_end(ap)
134 #define VA_LIST va_list
135 #define _VA_LIST_DEFINED //To deal with stdarg.h
136 #define __VA_LIST_defined //To deal with e32def.h
138 // These are for Symbian OS C++ code
139 #define VA_START(ap,pn) va_start(ap, pn)
140 #define VA_ARG(ap,type) va_arg(ap,type)
141 #define VA_END(ap) va_end(ap)
142 // This should prevent /stdlib/linc/stdarg.h from doing damage.
145 // now deal with stdarg_e.h
146 typedef va_list __e32_va_list;
149 // This is an EABI compliant compiler
154 // these are hopefully temporary
156 // defining this means we don't get __NAKED__ ctors
157 #ifndef __EABI_CTORS__
158 #define __EABI_CTORS__
161 //#define __EARLY_DEBUG__
163 #ifndef __SYMBIAN_STDCPP_SUPPORT__
168 // Support for throwing exceptions through embedded assembler
169 // Should only be needed user side
171 #define __EH_FRAME_ADDRESS(reg,offset) FRAME ADDRESS reg, offset
172 #define __EH_FRAME_PUSH2(reg1,reg2) FRAME PUSH {reg1, reg2}
173 #define __EH_FRAME_SAVE1(reg,offset) FRAME SAVE {reg}, offset