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