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 "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\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
28 #if defined(__PRODUCT_INCLUDE__)
29 #include __PRODUCT_INCLUDE__
32 // stuff from e32def.h
33 #define __NO_CLASS_CONSTS__
34 #define __NORETURN__ __declspec(noreturn)
35 #define __NORETURN_TERMINATOR()
36 #define IMPORT_C __declspec(dllimport)
37 #define EXPORT_C __declspec(dllexport)
43 Declares a class as being non-sharable.
45 If a class is non-sharable, then a class implemented in another DLL cannot
46 derive (inherit) from that class.
48 Declaring a class as non-sharable prevents the compiler from exporting compiler
49 implementation-specific symbols, i.e. run-time type-information and virtual
50 tables. This prevents classes in other DLLs from being able to derive from it.
53 - if a class is marked as non-sharable, then Symbian OS requires all
54 classes that are derived from that class, and which are also implemented in the same DLL,
55 to be declared as non-sharable.
56 - by default, a class is sharable.
58 The following code fragment shows how a non-sharable class is declared.
60 NONSHARABLE_CLASS(CMyClass) : public CBase
69 @param x The name of the class to be declared as non-sharable.
71 #define NONSHARABLE_CLASS(x) class __declspec(notshared) x
73 #define NONSHARABLE_STRUCT(x) struct __declspec(notshared) x
74 #define __NO_THROW throw ()
75 #define __THROW(t) throw (t)
76 #define TEMPLATE_SPECIALIZATION template<>
78 #define __int64 long long
80 #define __VALUE_IN_REGS__
81 #define I64LIT(x) x##LL
82 #define UI64LIT(x) x##ULL
85 // __TText from e32cmn.h also e32des16.h
87 typedef wchar_t __TText; // Only ISO C++ has wchar_t as a primitive type
88 #define __wchar_t_defined
90 typedef unsigned short __TText;
92 #define __TText_defined
94 // __NAKED__ from cpudefs.h
95 #define __NAKED__ __asm
96 #define ____ONLY_USE_NAKED_IN_CIA____ __asm
98 // Int64 and Uint64 from nkern\nklib.h
99 typedef long long Int64;
100 typedef unsigned long long Uint64;
102 // Here are GCC-E's definitions for stdarg.h
103 // These should be used by e.g. stdlib
108 #endif /* __cplusplus */
110 typedef struct __va_list { void *__ap; } va_list;
115 } /* namespace std */
117 using ::std::va_list;
120 #define va_start(ap, parmN) __builtin_va_start(ap.__ap, parmN)
121 #define va_arg(ap, type) __builtin_va_arg(ap.__ap, type)
122 #define va_end(ap) __builtin_va_end(ap.__ap)
125 #define VA_LIST va_list
126 #define _VA_LIST_DEFINED //To deal with stdarg.h
127 #define __VA_LIST_defined //To deal with e32def.h
129 // These are for Symbian OS C++ code
130 #define VA_START(ap,pn) va_start(ap, pn)
131 #define VA_ARG(ap,type) va_arg(ap,type)
132 #define VA_END(ap) va_end(ap)
133 // This should prevent /stdlib/linc/stdarg.h from doing damage.
136 // now deal with stdarg_e.h
137 typedef va_list __e32_va_list;
140 // This is an EABI compliant compiler
145 // these are hopefully temporary
147 // defining this means we don't get __NAKED__ ctors
148 #ifndef __EABI_CTORS__
149 #define __EABI_CTORS__
152 //#define __EARLY_DEBUG__
154 // Deal with operator new issues here
155 #include "../symcpp.h"
158 // Support for throwing exceptions through embedded assembler
159 // Should only be needed user side
161 #define __EH_FRAME_ADDRESS(reg,offset) FRAME ADDRESS reg, offset
162 #define __EH_FRAME_PUSH2(reg1,reg2) FRAME PUSH {reg1, reg2}
163 #define __EH_FRAME_SAVE1(reg,offset) FRAME SAVE {reg}, offset