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