epoc32/include/rvct/rvct.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     2
// All rights reserved.
williamr@4
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of the License "ARM EABI LICENCE.txt"
williamr@4
     5
// which accompanies this distribution, and is available
williamr@4
     6
// in kernel/eka/compsupp.
williamr@4
     7
//
williamr@4
     8
// Initial Contributors:
williamr@4
     9
// Nokia Corporation - initial contribution.
williamr@4
    10
//
williamr@4
    11
// Contributors:
williamr@4
    12
//
williamr@4
    13
// Description:
williamr@4
    14
// This is the preinclude file for the RVCT compiler. It contains all the compiler
williamr@4
    15
// specific definitions required by the Symbian OS source code.
williamr@4
    16
// 
williamr@4
    17
//
williamr@4
    18
williamr@4
    19
/**
williamr@4
    20
 @file
williamr@4
    21
 @publishedAll
williamr@4
    22
 @released
williamr@4
    23
*/
williamr@4
    24
williamr@4
    25
#if defined(__PRODUCT_INCLUDE__)
williamr@4
    26
#include __PRODUCT_INCLUDE__
williamr@4
    27
#endif
williamr@4
    28
williamr@4
    29
// stuff from e32def.h
williamr@4
    30
#define __NO_CLASS_CONSTS__
williamr@4
    31
#define __NORETURN__ __declspec(noreturn)
williamr@4
    32
#define __NORETURN_TERMINATOR()
williamr@4
    33
williamr@4
    34
#ifndef IMPORT_C
williamr@4
    35
#define IMPORT_C __declspec(dllimport)
williamr@4
    36
#endif
williamr@4
    37
williamr@4
    38
#ifndef EXPORT_C
williamr@4
    39
#define EXPORT_C __declspec(dllexport)
williamr@4
    40
#endif
williamr@4
    41
williamr@4
    42
#ifndef IMPORT_D
williamr@4
    43
#if __ARMCC_VERSION < 310000
williamr@4
    44
    #define IMPORT_D __declspec(dllexport)
williamr@4
    45
#else
williamr@4
    46
    #define IMPORT_D __declspec(dllimport)
williamr@4
    47
#endif
williamr@4
    48
#endif
williamr@4
    49
williamr@4
    50
#ifndef EXPORT_D
williamr@4
    51
#define EXPORT_D __declspec(dllexport)
williamr@4
    52
#endif
williamr@4
    53
williamr@4
    54
// Used by some of RVCT's header files. For more information, see "C Library ABI for
williamr@4
    55
// the ARM Architecture."
williamr@4
    56
#define _AEABI_PORTABILITY_LEVEL 0
williamr@4
    57
williamr@4
    58
/**
williamr@4
    59
Declares a class as being non-sharable.
williamr@4
    60
williamr@4
    61
If a class is non-sharable, then a class implemented in another DLL cannot
williamr@4
    62
derive (inherit) from that class.
williamr@4
    63
williamr@4
    64
Declaring a class as non-sharable prevents the compiler from exporting compiler
williamr@4
    65
implementation-specific symbols, i.e. run-time type-information and virtual
williamr@4
    66
tables. This prevents classes in other DLLs from being able to derive from it.
williamr@4
    67
williamr@4
    68
Note :
williamr@4
    69
- if a class is marked as non-sharable, then Symbian OS requires all
williamr@4
    70
classes that are derived from that class, and which are also implemented in the same DLL, 
williamr@4
    71
to be declared as non-sharable.
williamr@4
    72
- by default, a class is sharable.
williamr@4
    73
williamr@4
    74
The following code fragment shows how a non-sharable class is declared.
williamr@4
    75
williamr@4
    76
@code
williamr@4
    77
NONSHARABLE_CLASS(CMyClass) : public CBase
williamr@4
    78
{
williamr@4
    79
public :
williamr@4
    80
...
williamr@4
    81
private :
williamr@4
    82
...
williamr@4
    83
}
williamr@4
    84
@endcode
williamr@4
    85
williamr@4
    86
@param x  The name of the class to be declared as non-sharable.
williamr@4
    87
*/
williamr@4
    88
#define NONSHARABLE_CLASS(x)    class __declspec(notshared) x
williamr@4
    89
#define NONSHARABLE_STRUCT(x)   struct __declspec(notshared) x
williamr@4
    90
williamr@4
    91
#define __NO_THROW throw ()
williamr@4
    92
#define __THROW(t) throw (t)
williamr@4
    93
williamr@4
    94
#define TEMPLATE_SPECIALIZATION template<>
williamr@4
    95
williamr@4
    96
#ifndef __int64
williamr@4
    97
#define __int64  long long
williamr@4
    98
#endif
williamr@4
    99
williamr@4
   100
#define __VALUE_IN_REGS__ __value_in_regs
williamr@4
   101
williamr@4
   102
#define	I64LIT(x)	x##LL
williamr@4
   103
#define	UI64LIT(x)	x##ULL
williamr@4
   104
williamr@4
   105
#define __SOFTFP	__softfp
williamr@4
   106
williamr@4
   107
// __TText from e32cmn.h also e32des16.h
williamr@4
   108
#ifdef __cplusplus
williamr@4
   109
typedef wchar_t __TText;	// Only ISO C++ has wchar_t as a primitive type
williamr@4
   110
#define __wchar_t_defined
williamr@4
   111
#else
williamr@4
   112
typedef unsigned short __TText;	
williamr@4
   113
#endif
williamr@4
   114
#define __TText_defined
williamr@4
   115
williamr@4
   116
// __NAKED__ from cpudefs.h
williamr@4
   117
#define __NAKED__ __asm
williamr@4
   118
#define ____ONLY_USE_NAKED_IN_CIA____ __asm
williamr@4
   119
#define __WEAK__  __attribute__((weak))
williamr@4
   120
williamr@4
   121
// Int64 and Uint64 from nkern\nklib.h
williamr@4
   122
typedef long long Int64;
williamr@4
   123
typedef unsigned long long Uint64;
williamr@4
   124
williamr@4
   125
// Here are RVCT's definitions for stdarg.h
williamr@4
   126
// These should be used by e.g. stdlib
williamr@4
   127
williamr@4
   128
#ifdef __cplusplus
williamr@4
   129
namespace std { extern "C" {
williamr@4
   130
#endif
williamr@4
   131
williamr@4
   132
    typedef struct __va_list { void *__ap; } va_list;
williamr@4
   133
williamr@4
   134
#ifdef __cplusplus
williamr@4
   135
} } 
williamr@4
   136
using ::std::va_list;
williamr@4
   137
#endif
williamr@4
   138
williamr@4
   139
#define va_start(ap, parmN) __va_start(ap, parmN)
williamr@4
   140
#define va_arg(ap, type)    __va_arg(ap, type)
williamr@4
   141
#define va_end(ap)          ((void)0)
williamr@4
   142
williamr@4
   143
// These are for Symbian OS C++ code
williamr@4
   144
#define VA_START(ap,pn) va_start(ap, pn)
williamr@4
   145
#define VA_ARG(ap,type) va_arg(ap,type)
williamr@4
   146
#define VA_END(ap)      va_end(ap)
williamr@4
   147
#define VA_LIST va_list
williamr@4
   148
#define __VA_LIST_defined
williamr@4
   149
// This should prevent /stdlib/linc/stdarg.h from doing damage.
williamr@4
   150
#define _STDARG_H
williamr@4
   151
williamr@4
   152
// now deal with stdarg_e.h
williamr@4
   153
typedef va_list __e32_va_list;
williamr@4
   154
#define _STDARG_E_H
williamr@4
   155
williamr@4
   156
// This is an EABI compliant compiler
williamr@4
   157
#ifndef __EABI__
williamr@4
   158
#define __EABI__
williamr@4
   159
#endif
williamr@4
   160
williamr@4
   161
// These are hopefully temporary.
williamr@4
   162
williamr@4
   163
// defining this means we don't get __NAKED__ ctors
williamr@4
   164
#ifndef __EABI_CTORS__
williamr@4
   165
#define __EABI_CTORS__
williamr@4
   166
#endif
williamr@4
   167
williamr@4
   168
#ifndef __SYMBIAN_STDCPP_SUPPORT__
williamr@4
   169
	#include <symcpp.h>
williamr@4
   170
#endif
williamr@4
   171
williamr@4
   172
#ifdef __cplusplus
williamr@4
   173
    // Support for throwing exceptions through embedded assembler Should only be
williamr@4
   174
    // needed user side.
williamr@4
   175
    
williamr@4
   176
    #define	__EH_FRAME_ADDRESS(reg,offset)  FRAME ADDRESS reg, offset
williamr@4
   177
    #define __EH_FRAME_PUSH2(reg1,reg2)     FRAME PUSH {reg1, reg2}
williamr@4
   178
    #define __EH_FRAME_SAVE1(reg,offset)    FRAME SAVE {reg}, offset
williamr@4
   179
#endif
williamr@4
   180