1.1 --- a/epoc32/include/rvct2_1/rvct2_1.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/rvct2_1/rvct2_1.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,196 @@
1.4 -rvct2_1.h
1.5 +// Copyright (c) 2002-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\rvct2_1\rvct2_1.h
1.19 +// This is the preinclude file for the rvct 2.1 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 +#ifdef __ARMCC_VERSION
1.33 +#if (__ARMCC_VERSION < 210000 || __ARMCC_VERSION >= 220000)
1.34 +#error This instantiation of the build requires use of RVCT 2.1
1.35 +#endif
1.36 +#endif
1.37 +
1.38 +#if defined(__PRODUCT_INCLUDE__)
1.39 +#include __PRODUCT_INCLUDE__
1.40 +#endif
1.41 +
1.42 +
1.43 +// stuff from e32def.h
1.44 +#define __NO_CLASS_CONSTS__
1.45 +#define __NORETURN__ __declspec(noreturn)
1.46 +#define __NORETURN_TERMINATOR()
1.47 +#define IMPORT_C __declspec(dllimport)
1.48 +#define EXPORT_C __declspec(dllexport)
1.49 +
1.50 +
1.51 +
1.52 +
1.53 +/**
1.54 +Declares a class as being non-sharable.
1.55 +
1.56 +If a class is non-sharable, then a class implemented in another DLL cannot
1.57 +derive (inherit) from that class.
1.58 +
1.59 +Declaring a class as non-sharable prevents the compiler from exporting compiler
1.60 +implementation-specific symbols, i.e. run-time type-information and virtual
1.61 +tables. This prevents classes in other DLLs from being able to derive from it.
1.62 +
1.63 +Note :
1.64 +- if a class is marked as non-sharable, then Symbian OS requires all
1.65 +classes that are derived from that class, and which are also implemented in the same DLL,
1.66 +to be declared as non-sharable.
1.67 +- by default, a class is sharable.
1.68 +
1.69 +The following code fragment shows how a non-sharable class is declared.
1.70 +
1.71 +@code
1.72 +NONSHARABLE_CLASS(CMyClass) : public CBase
1.73 +{
1.74 +public :
1.75 +...
1.76 +private :
1.77 +...
1.78 +}
1.79 +@endcode
1.80 +
1.81 +@param x The name of the class to be declared as non-sharable.
1.82 +*/
1.83 +#define NONSHARABLE_CLASS(x) class __declspec(notshared) x
1.84 +#define NONSHARABLE_STRUCT(x) struct __declspec(notshared) x
1.85 +#define __NO_THROW throw ()
1.86 +#define __THROW(t) throw (t)
1.87 +#define TEMPLATE_SPECIALIZATION template<>
1.88 +#ifndef __int64
1.89 +#define __int64 long long
1.90 +#endif
1.91 +#define __VALUE_IN_REGS__ __value_in_regs
1.92 +#define I64LIT(x) x##LL
1.93 +#define UI64LIT(x) x##ULL
1.94 +#define __SOFTFP __softfp
1.95 +
1.96 +// __TText from e32cmn.h also e32des16.h
1.97 +#ifdef __cplusplus
1.98 +typedef wchar_t __TText; // Only ISO C++ has wchar_t as a primitive type
1.99 +#define __wchar_t_defined
1.100 +#else
1.101 +typedef unsigned short __TText;
1.102 +#endif
1.103 +#define __TText_defined
1.104 +
1.105 +// __NAKED__ from cpudefs.h
1.106 +#define __NAKED__ __asm
1.107 +#define ____ONLY_USE_NAKED_IN_CIA____ __asm
1.108 +
1.109 +// Int64 and Uint64 from nkern\nklib.h
1.110 +typedef long long Int64;
1.111 +typedef unsigned long long Uint64;
1.112 +
1.113 +// Here are RVCT 2.0's definitions for stdarg.h
1.114 +// These should be used by e.g. stdlib
1.115 +
1.116 +// see if we're using the BETA B compiler
1.117 +#if (__ARMCC_VERSION == 200022)
1.118 +#define RVCTBETA
1.119 +#endif
1.120 +
1.121 +#ifdef __cplusplus
1.122 + namespace std {
1.123 + extern "C" {
1.124 +#endif /* __cplusplus */
1.125 +
1.126 +#ifdef RVCTBETA
1.127 + typedef int *va_list[1];
1.128 +#else
1.129 + typedef struct __va_list { void *__ap; } va_list;
1.130 +#endif
1.131 +
1.132 +#ifdef __cplusplus
1.133 + } /* extern "C" */
1.134 + } /* namespace std */
1.135 +
1.136 + using ::std::va_list;
1.137 +#endif
1.138 +
1.139 +#define va_start(ap, parmN) __va_start(ap, parmN)
1.140 +#define va_arg(ap, type) __va_arg(ap, type)
1.141 +#define va_end(ap) ((void)0)
1.142 +
1.143 +// These are for Symbian OS C++ code
1.144 +#define VA_START(ap,pn) va_start(ap, pn)
1.145 +#define VA_ARG(ap,type) va_arg(ap,type)
1.146 +#define VA_END(ap) va_end(ap)
1.147 +#define VA_LIST va_list
1.148 +#define __VA_LIST_defined
1.149 +// This should prevent /stdlib/linc/stdarg.h from doing damage.
1.150 +#define _STDARG_H
1.151 +
1.152 +// now deal with stdarg_e.h
1.153 +typedef va_list __e32_va_list;
1.154 +#define _STDARG_E_H
1.155 +
1.156 +// This is an EABI compliant compiler
1.157 +#ifndef __EABI__
1.158 +#define __EABI__
1.159 +#endif
1.160 +
1.161 +// these are hopefully temporary
1.162 +
1.163 +// defining this means we don't get __NAKED__ ctors
1.164 +#ifndef __EABI_CTORS__
1.165 +#define __EABI_CTORS__
1.166 +#endif
1.167 +
1.168 +//#define __EARLY_DEBUG__
1.169 +
1.170 +// Deal with operator new issues here
1.171 +#ifdef __cplusplus
1.172 +namespace std {
1.173 + struct nothrow_t { };
1.174 + extern const nothrow_t nothrow;
1.175 +}
1.176 +
1.177 +IMPORT_C void* operator new(unsigned int aSize) __NO_THROW;
1.178 +
1.179 +IMPORT_C void* operator new[](unsigned int aSize) __NO_THROW;
1.180 +
1.181 +IMPORT_C void* operator new(unsigned int aSize, const std::nothrow_t& aNoThrow) __NO_THROW;
1.182 +
1.183 +IMPORT_C void* operator new[](unsigned int aSize, const std::nothrow_t& aNoThrow) __NO_THROW;
1.184 +
1.185 +IMPORT_C void operator delete(void* aPtr) __NO_THROW;
1.186 +
1.187 +IMPORT_C void operator delete[](void* aPtr) __NO_THROW;
1.188 +
1.189 +IMPORT_C void operator delete(void* aPtr, const std::nothrow_t& aNoThrow) __NO_THROW;
1.190 +
1.191 +IMPORT_C void operator delete[](void* aPtr, const std::nothrow_t& aNoThrow) __NO_THROW;
1.192 +
1.193 +// Support for throwing exceptions through embedded assembler
1.194 +// Should only be needed user side
1.195 +
1.196 +#define __EH_FRAME_ADDRESS(reg,offset) FRAME ADDRESS reg, offset
1.197 +#define __EH_FRAME_PUSH2(reg1,reg2) FRAME PUSH {reg1, reg2}
1.198 +#define __EH_FRAME_SAVE1(reg,offset) FRAME SAVE {reg}, offset
1.199 +
1.200 +#endif