williamr@2: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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 williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // e32\compsupp\rvct2_2\rvct2_2.h williamr@2: // This is the preinclude file for the rvct 2.2 compiler williamr@2: // It contains all the compiler specific definitions required by the SOS source williamr@2: // williamr@2: // williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: @file williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: williamr@2: #ifdef __ARMCC_VERSION williamr@2: #if (__ARMCC_VERSION < 220435 || __ARMCC_VERSION >= 230000) williamr@2: #error This instantiation of the build requires use of RVCT 2.2 Build 435 (or later) williamr@2: #endif williamr@2: #endif williamr@2: williamr@2: #if defined(__PRODUCT_INCLUDE__) williamr@2: #include __PRODUCT_INCLUDE__ williamr@2: #endif williamr@2: williamr@2: williamr@2: // stuff from e32def.h williamr@2: #define __NO_CLASS_CONSTS__ williamr@2: #define __NORETURN__ __declspec(noreturn) williamr@2: #define __NORETURN_TERMINATOR() williamr@2: #ifndef IMPORT_C williamr@2: #define IMPORT_C __declspec(dllimport) williamr@2: #endif williamr@2: #ifndef EXPORT_C williamr@2: #define EXPORT_C __declspec(dllexport) williamr@2: #endif williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: Declares a class as being non-sharable. williamr@2: williamr@2: If a class is non-sharable, then a class implemented in another DLL cannot williamr@2: derive (inherit) from that class. williamr@2: williamr@2: Declaring a class as non-sharable prevents the compiler from exporting compiler williamr@2: implementation-specific symbols, i.e. run-time type-information and virtual williamr@2: tables. This prevents classes in other DLLs from being able to derive from it. williamr@2: williamr@2: Note : williamr@2: - if a class is marked as non-sharable, then Symbian OS requires all williamr@2: classes that are derived from that class, and which are also implemented in the same DLL, williamr@2: to be declared as non-sharable. williamr@2: - by default, a class is sharable. williamr@2: williamr@2: The following code fragment shows how a non-sharable class is declared. williamr@2: williamr@2: @code williamr@2: NONSHARABLE_CLASS(CMyClass) : public CBase williamr@2: { williamr@2: public : williamr@2: ... williamr@2: private : williamr@2: ... williamr@2: } williamr@2: @endcode williamr@2: williamr@2: @param x The name of the class to be declared as non-sharable. williamr@2: */ williamr@2: #define NONSHARABLE_CLASS(x) class __declspec(notshared) x williamr@2: #define NONSHARABLE_STRUCT(x) struct __declspec(notshared) x williamr@2: #define __NO_THROW throw () williamr@2: #define __THROW(t) throw (t) williamr@2: #define TEMPLATE_SPECIALIZATION template<> williamr@2: #ifndef __int64 williamr@2: #define __int64 long long williamr@2: #endif williamr@2: #define __VALUE_IN_REGS__ __value_in_regs williamr@2: #define I64LIT(x) x##LL williamr@2: #define UI64LIT(x) x##ULL williamr@2: #define __SOFTFP __softfp williamr@2: williamr@2: // __TText from e32cmn.h also e32des16.h williamr@2: #ifdef __cplusplus williamr@2: typedef wchar_t __TText; // Only ISO C++ has wchar_t as a primitive type williamr@2: #define __wchar_t_defined williamr@2: #else williamr@2: typedef unsigned short __TText; williamr@2: #endif williamr@2: #define __TText_defined williamr@2: williamr@2: // __NAKED__ from cpudefs.h williamr@2: #define __NAKED__ __asm williamr@2: #define ____ONLY_USE_NAKED_IN_CIA____ __asm williamr@2: williamr@2: // Int64 and Uint64 from nkern\nklib.h williamr@2: typedef long long Int64; williamr@2: typedef unsigned long long Uint64; williamr@2: williamr@2: // Here are RVCT 2.2's definitions for stdarg.h williamr@2: // These should be used by e.g. stdlib williamr@2: williamr@2: #ifdef __cplusplus williamr@2: namespace std { williamr@2: extern "C" { williamr@2: #endif /* __cplusplus */ williamr@2: williamr@2: typedef struct __va_list { void *__ap; } va_list; williamr@2: williamr@2: #ifdef __cplusplus williamr@2: } /* extern "C" */ williamr@2: } /* namespace std */ williamr@2: williamr@2: using ::std::va_list; williamr@2: #endif williamr@2: williamr@2: #define va_start(ap, parmN) __va_start(ap, parmN) williamr@2: #define va_arg(ap, type) __va_arg(ap, type) williamr@2: #define va_end(ap) ((void)0) williamr@2: williamr@2: // These are for Symbian OS C++ code williamr@2: #define VA_START(ap,pn) va_start(ap, pn) williamr@2: #define VA_ARG(ap,type) va_arg(ap,type) williamr@2: #define VA_END(ap) va_end(ap) williamr@2: #define VA_LIST va_list williamr@2: #define __VA_LIST_defined williamr@2: // This should prevent /stdlib/linc/stdarg.h from doing damage. williamr@2: #define _STDARG_H williamr@2: williamr@2: // now deal with stdarg_e.h williamr@2: typedef va_list __e32_va_list; williamr@2: #define _STDARG_E_H williamr@2: williamr@2: // This is an EABI compliant compiler williamr@2: #ifndef __EABI__ williamr@2: #define __EABI__ williamr@2: #endif williamr@2: williamr@2: // these are hopefully temporary williamr@2: williamr@2: // defining this means we don't get __NAKED__ ctors williamr@2: #ifndef __EABI_CTORS__ williamr@2: #define __EABI_CTORS__ williamr@2: #endif williamr@2: williamr@2: //#define __EARLY_DEBUG__ williamr@2: williamr@2: // Deal with operator new issues here williamr@2: #include "../symcpp.h" williamr@2: williamr@2: #ifdef __cplusplus williamr@2: // Support for throwing exceptions through embedded assembler williamr@2: // Should only be needed user side williamr@2: williamr@2: #define __EH_FRAME_ADDRESS(reg,offset) FRAME ADDRESS reg, offset williamr@2: #define __EH_FRAME_PUSH2(reg1,reg2) FRAME PUSH {reg1, reg2} williamr@2: #define __EH_FRAME_SAVE1(reg,offset) FRAME SAVE {reg}, offset williamr@2: williamr@2: #endif