os/kernelhwsrv/kernel/eka/compsupp/rvct2_1/rvct2_1.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2002-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 "ARM EABI LICENCE.txt"
     5 // which accompanies this distribution, and is available
     6 // in kernel/eka/compsupp.
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // e32\compsupp\rvct2_1\rvct2_1.h
    15 // This is the preinclude file for the rvct 2.1 compiler
    16 // It contains all the compiler specific definitions required by the SOS source
    17 // 
    18 //
    19 
    20 /**
    21  @file
    22  @publishedAll
    23  @released
    24 */
    25 
    26 #ifdef __ARMCC_VERSION
    27 #if (__ARMCC_VERSION < 210000 || __ARMCC_VERSION >= 220000)
    28 #error This instantiation of the build requires use of RVCT 2.1
    29 #endif
    30 #endif
    31 
    32 #if defined(__PRODUCT_INCLUDE__)
    33 #include __PRODUCT_INCLUDE__
    34 #endif
    35 
    36 
    37 // stuff from e32def.h
    38 #define __NO_CLASS_CONSTS__
    39 #define __NORETURN__ __declspec(noreturn)
    40 #define __NORETURN_TERMINATOR()
    41 #define IMPORT_C __declspec(dllimport) 
    42 #define EXPORT_C __declspec(dllexport)
    43 
    44 
    45 
    46 
    47 /**
    48 Declares a class as being non-sharable.
    49 
    50 If a class is non-sharable, then a class implemented in another DLL cannot
    51 derive (inherit) from that class.
    52 
    53 Declaring a class as non-sharable prevents the compiler from exporting compiler
    54 implementation-specific symbols, i.e. run-time type-information and virtual
    55 tables. This prevents classes in other DLLs from being able to derive from it.
    56 
    57 Note :
    58 - if a class is marked as non-sharable, then Symbian OS requires all
    59 classes that are derived from that class, and which are also implemented in the same DLL, 
    60 to be declared as non-sharable.
    61 - by default, a class is sharable.
    62 
    63 The following code fragment shows how a non-sharable class is declared.
    64 
    65 @code
    66 NONSHARABLE_CLASS(CMyClass) : public CBase
    67 {
    68 public :
    69 ...
    70 private :
    71 ...
    72 }
    73 @endcode
    74 
    75 @param x  The name of the class to be declared as non-sharable.
    76 */
    77 #define NONSHARABLE_CLASS(x) class __declspec(notshared) x
    78 #define NONSHARABLE_STRUCT(x) struct __declspec(notshared) x
    79 #define __NO_THROW throw ()
    80 #define __THROW(t) throw (t)
    81 #define TEMPLATE_SPECIALIZATION template<>
    82 #ifndef __int64
    83 #define __int64  long long
    84 #endif
    85 #define __VALUE_IN_REGS__ __value_in_regs
    86 #define	I64LIT(x)	x##LL
    87 #define	UI64LIT(x)	x##ULL
    88 #define __SOFTFP	__softfp
    89 
    90 // __TText from e32cmn.h also e32des16.h
    91 #ifdef __cplusplus
    92 typedef wchar_t __TText;	// Only ISO C++ has wchar_t as a primitive type
    93 #define __wchar_t_defined
    94 #else
    95 typedef unsigned short __TText;	
    96 #endif
    97 #define __TText_defined
    98 
    99 // __NAKED__ from cpudefs.h
   100 #define __NAKED__ __asm
   101 #define ____ONLY_USE_NAKED_IN_CIA____ __asm
   102 
   103 // Int64 and Uint64 from nkern\nklib.h
   104 typedef long long Int64;
   105 typedef unsigned long long Uint64;
   106 
   107 // Here are RVCT 2.0's definitions for stdarg.h
   108 // These should be used by e.g. stdlib
   109 
   110 // see if we're using the BETA B compiler
   111 #if (__ARMCC_VERSION == 200022)
   112 #define RVCTBETA
   113 #endif
   114 
   115 #ifdef __cplusplus
   116     namespace std {
   117         extern "C" {
   118 #endif  /* __cplusplus */
   119 
   120 #ifdef RVCTBETA
   121 	  typedef int *va_list[1];
   122 #else
   123 	  typedef struct __va_list { void *__ap; } va_list;
   124 #endif
   125 
   126 #ifdef __cplusplus
   127 	}  /* extern "C" */
   128     }  /* namespace std */
   129 
   130     using ::std::va_list;
   131 #endif
   132 
   133 #define va_start(ap, parmN) __va_start(ap, parmN)
   134 #define va_arg(ap, type) __va_arg(ap, type)
   135 #define va_end(ap) ((void)0)
   136 
   137 // These are for Symbian OS C++ code
   138 #define VA_START(ap,pn) va_start(ap, pn)
   139 #define VA_ARG(ap,type) va_arg(ap,type)
   140 #define VA_END(ap)      va_end(ap)
   141 #define VA_LIST va_list
   142 #define __VA_LIST_defined
   143 // This should prevent /stdlib/linc/stdarg.h from doing damage.
   144 #define _STDARG_H
   145 
   146 // now deal with stdarg_e.h
   147 typedef va_list __e32_va_list;
   148 #define _STDARG_E_H
   149 
   150 // This is an EABI compliant compiler
   151 #ifndef __EABI__
   152 #define __EABI__
   153 #endif
   154 
   155 // these are hopefully temporary
   156 
   157 // defining this means we don't get __NAKED__ ctors
   158 #ifndef __EABI_CTORS__
   159 #define __EABI_CTORS__
   160 #endif
   161 
   162 //#define __EARLY_DEBUG__
   163 
   164 // Deal with operator new issues here
   165 #ifdef __cplusplus
   166 namespace std {
   167 	struct nothrow_t { };
   168 	extern const nothrow_t nothrow;
   169 }
   170 
   171 IMPORT_C void* operator new(unsigned int aSize) __NO_THROW;
   172 
   173 IMPORT_C void* operator new[](unsigned int aSize) __NO_THROW;
   174 
   175 IMPORT_C void* operator new(unsigned int aSize, const std::nothrow_t& aNoThrow) __NO_THROW;
   176 
   177 IMPORT_C void* operator new[](unsigned int aSize, const std::nothrow_t& aNoThrow) __NO_THROW;
   178 
   179 IMPORT_C void operator delete(void* aPtr) __NO_THROW;
   180 
   181 IMPORT_C void operator delete[](void* aPtr) __NO_THROW;
   182 
   183 IMPORT_C void operator delete(void* aPtr, const std::nothrow_t& aNoThrow) __NO_THROW;
   184 
   185 IMPORT_C void operator delete[](void* aPtr, const std::nothrow_t& aNoThrow) __NO_THROW;
   186 
   187 // Support for throwing exceptions through embedded assembler
   188 // Should only be needed user side
   189 
   190 #define	__EH_FRAME_ADDRESS(reg,offset)	FRAME ADDRESS reg, offset
   191 #define __EH_FRAME_PUSH2(reg1,reg2) FRAME PUSH {reg1, reg2}
   192 #define __EH_FRAME_SAVE1(reg,offset) FRAME SAVE {reg}, offset
   193 
   194 #endif