1.1 --- a/epoc32/include/gcce/gcce.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/gcce/gcce.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,165 @@
1.4 -gcce.h
1.5 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +// e32\compsupp\gcce\gcce.h
1.19 +// This is the preinclude file for the GCC-E compiler
1.20 +// It contains all the compiler specific definitions required by the SOS source
1.21 +//
1.22 +//
1.23 +
1.24 +
1.25 +
1.26 +/**
1.27 + @file
1.28 + @publishedAll
1.29 + @released
1.30 +*/
1.31 +
1.32 +#if defined(__PRODUCT_INCLUDE__)
1.33 +#include __PRODUCT_INCLUDE__
1.34 +#endif
1.35 +
1.36 +// stuff from e32def.h
1.37 +#define __NO_CLASS_CONSTS__
1.38 +#define __NORETURN__ __declspec(noreturn)
1.39 +#define __NORETURN_TERMINATOR()
1.40 +#define IMPORT_C __declspec(dllimport)
1.41 +#define EXPORT_C __declspec(dllexport)
1.42 +
1.43 +
1.44 +
1.45 +
1.46 +/**
1.47 +Declares a class as being non-sharable.
1.48 +
1.49 +If a class is non-sharable, then a class implemented in another DLL cannot
1.50 +derive (inherit) from that class.
1.51 +
1.52 +Declaring a class as non-sharable prevents the compiler from exporting compiler
1.53 +implementation-specific symbols, i.e. run-time type-information and virtual
1.54 +tables. This prevents classes in other DLLs from being able to derive from it.
1.55 +
1.56 +Note :
1.57 +- if a class is marked as non-sharable, then Symbian OS requires all
1.58 +classes that are derived from that class, and which are also implemented in the same DLL,
1.59 +to be declared as non-sharable.
1.60 +- by default, a class is sharable.
1.61 +
1.62 +The following code fragment shows how a non-sharable class is declared.
1.63 +@code
1.64 +NONSHARABLE_CLASS(CMyClass) : public CBase
1.65 + {
1.66 + public :
1.67 + ...
1.68 + private :
1.69 + ...
1.70 + }
1.71 +@endcode
1.72 +
1.73 +@param x The name of the class to be declared as non-sharable.
1.74 +*/
1.75 +#define NONSHARABLE_CLASS(x) class __declspec(notshared) x
1.76 +
1.77 +#define NONSHARABLE_STRUCT(x) struct __declspec(notshared) x
1.78 +#define __NO_THROW throw ()
1.79 +#define __THROW(t) throw (t)
1.80 +#define TEMPLATE_SPECIALIZATION template<>
1.81 +#ifndef __int64
1.82 +#define __int64 long long
1.83 +#endif
1.84 +#define __VALUE_IN_REGS__
1.85 +#define I64LIT(x) x##LL
1.86 +#define UI64LIT(x) x##ULL
1.87 +#define __SOFTFP
1.88 +
1.89 +// __TText from e32cmn.h also e32des16.h
1.90 +#ifdef __cplusplus
1.91 +typedef wchar_t __TText; // Only ISO C++ has wchar_t as a primitive type
1.92 +#define __wchar_t_defined
1.93 +#else
1.94 +typedef unsigned short __TText;
1.95 +#endif
1.96 +#define __TText_defined
1.97 +
1.98 +// __NAKED__ from cpudefs.h
1.99 +#define __NAKED__ __asm
1.100 +#define ____ONLY_USE_NAKED_IN_CIA____ __asm
1.101 +
1.102 +// Int64 and Uint64 from nkern\nklib.h
1.103 +typedef long long Int64;
1.104 +typedef unsigned long long Uint64;
1.105 +
1.106 +// Here are GCC-E's definitions for stdarg.h
1.107 +// These should be used by e.g. stdlib
1.108 +
1.109 +#ifdef __cplusplus
1.110 + namespace std {
1.111 + extern "C" {
1.112 +#endif /* __cplusplus */
1.113 +
1.114 +typedef struct __va_list { void *__ap; } va_list;
1.115 +
1.116 +
1.117 +#ifdef __cplusplus
1.118 + } /* extern "C" */
1.119 + } /* namespace std */
1.120 +
1.121 + using ::std::va_list;
1.122 +#endif
1.123 +
1.124 +#define va_start(ap, parmN) __builtin_va_start(ap.__ap, parmN)
1.125 +#define va_arg(ap, type) __builtin_va_arg(ap.__ap, type)
1.126 +#define va_end(ap) __builtin_va_end(ap.__ap)
1.127 +
1.128 +
1.129 +#define VA_LIST va_list
1.130 +#define _VA_LIST_DEFINED //To deal with stdarg.h
1.131 +#define __VA_LIST_defined //To deal with e32def.h
1.132 +
1.133 +// These are for Symbian OS C++ code
1.134 +#define VA_START(ap,pn) va_start(ap, pn)
1.135 +#define VA_ARG(ap,type) va_arg(ap,type)
1.136 +#define VA_END(ap) va_end(ap)
1.137 +// This should prevent /stdlib/linc/stdarg.h from doing damage.
1.138 +#define _STDARG_H
1.139 +
1.140 +// now deal with stdarg_e.h
1.141 +typedef va_list __e32_va_list;
1.142 +#define _STDARG_E_H
1.143 +
1.144 +// This is an EABI compliant compiler
1.145 +#ifndef __EABI__
1.146 +#define __EABI__
1.147 +#endif
1.148 +
1.149 +// these are hopefully temporary
1.150 +
1.151 +// defining this means we don't get __NAKED__ ctors
1.152 +#ifndef __EABI_CTORS__
1.153 +#define __EABI_CTORS__
1.154 +#endif
1.155 +
1.156 +//#define __EARLY_DEBUG__
1.157 +
1.158 +// Deal with operator new issues here
1.159 +#include "../symcpp.h"
1.160 +
1.161 +#ifdef __cplusplus
1.162 +// Support for throwing exceptions through embedded assembler
1.163 +// Should only be needed user side
1.164 +
1.165 +#define __EH_FRAME_ADDRESS(reg,offset) FRAME ADDRESS reg, offset
1.166 +#define __EH_FRAME_PUSH2(reg1,reg2) FRAME PUSH {reg1, reg2}
1.167 +#define __EH_FRAME_SAVE1(reg,offset) FRAME SAVE {reg}, offset
1.168 +
1.169 +#endif