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