epoc32/include/gcc.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) 2007-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 "Eclipse Public License v1.0"
williamr@4
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
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
// e32\include\gcc.h
williamr@4
    15
// This is a preinclude file for GCC compilers. Currently only tested with GCC 3.4.4.
williamr@4
    16
// 
williamr@4
    17
//
williamr@4
    18
williamr@4
    19
/**
williamr@4
    20
 @file
williamr@4
    21
 @internalAll
williamr@4
    22
*/
williamr@4
    23
williamr@4
    24
// Check this header is being used as anticipated
williamr@4
    25
#ifndef __GCC32__
williamr@4
    26
#error Unexpected include of GCC header
williamr@4
    27
#endif
williamr@4
    28
#ifndef __X86__
williamr@4
    29
#error GCC header untested on non-X86 platforms
williamr@4
    30
#endif
williamr@4
    31
williamr@4
    32
// Do product include if not done already
williamr@4
    33
#ifdef PRODUCT_INCLUDE
williamr@4
    34
#include PRODUCT_INCLUDE
williamr@4
    35
#endif
williamr@4
    36
williamr@4
    37
// Visibility
williamr@4
    38
#define IMPORT_C
williamr@4
    39
#define IMPORT_D __attribute__((dllimport))
williamr@4
    40
#define EXPORT_C __attribute__((dllexport))
williamr@4
    41
#define EXPORT_D 
williamr@4
    42
#ifdef GCC4_OR_LATER // this would be nice... use in conjunction with -fvisibility=hidden
williamr@4
    43
#undef  EXPORT_C
williamr@4
    44
#define EXPORT_C __attribute__((visibility("default")))
williamr@4
    45
#endif
williamr@4
    46
williamr@4
    47
// Varargs
williamr@4
    48
typedef __builtin_va_list va_list;
williamr@4
    49
#define va_start(v, l) __builtin_va_start(v, l)
williamr@4
    50
#define va_arg(v, l) __builtin_va_arg(v, l)
williamr@4
    51
#define va_end(v) __builtin_va_end(v)
williamr@4
    52
#define VA_LIST va_list
williamr@4
    53
#define _VA_LIST_DEFINED //To deal with stdarg.h
williamr@4
    54
#define __VA_LIST_defined //To deal with e32def.h
williamr@4
    55
#define VA_START(ap,pn) va_start(ap, pn)
williamr@4
    56
#define VA_ARG(ap,type) va_arg(ap,type)
williamr@4
    57
#define VA_END(ap)      va_end(ap)
williamr@4
    58
williamr@4
    59
// Stdlib/OpenEnv support
williamr@4
    60
// This should prevent /stdlib/linc/stdarg.h from doing damage.
williamr@4
    61
#define _STDARG_H
williamr@4
    62
// now deal with stdarg_e.h
williamr@4
    63
typedef va_list __e32_va_list;
williamr@4
    64
#define _STDARG_E_H
williamr@4
    65
// wchar_t is a primtive type for C++ on GCC
williamr@4
    66
#ifdef __cplusplus
williamr@4
    67
#define __wchar_t_defined
williamr@4
    68
#endif
williamr@4
    69
williamr@4
    70
// General
williamr@4
    71
#define __NO_CLASS_CONSTS__
williamr@4
    72
#define	I64LIT(x)	x##LL
williamr@4
    73
#define	UI64LIT(x)	x##ULL
williamr@4
    74
#define __SOFTFP
williamr@4
    75
#define __NORETURN__  __attribute__ ((noreturn))
williamr@4
    76
#define NONSHARABLE_CLASS(x) class /*__attribute__(notshared)*/ x
williamr@4
    77
#define NONSHARABLE_STRUCT(x) struct /*__attribute__(notshared)*/ x
williamr@4
    78
#define __NO_THROW //throw ()
williamr@4
    79
#define __THROW(t) //throw (t)
williamr@4
    80
#define TEMPLATE_SPECIALIZATION template<>
williamr@4
    81
williamr@4
    82
#ifndef __cdecl
williamr@4
    83
#define __cdecl __attribute__((cdecl))
williamr@4
    84
#endif
williamr@4
    85
#ifndef __fastcall
williamr@4
    86
#define __fastcall __attribute__((fastcall))
williamr@4
    87
#endif
williamr@4
    88
#ifndef __stdcall
williamr@4
    89
#define __stdcall __attribute__((stdcall))
williamr@4
    90
#endif
williamr@4
    91
williamr@4
    92
// These are built-in defines during compilation stage but are also required (and not defined) during makmake stage
williamr@4
    93
#ifndef __GNUC__
williamr@4
    94
#define __GNUC__ 3
williamr@4
    95
#endif
williamr@4
    96
williamr@4
    97
#ifndef __i386
williamr@4
    98
#define __i386
williamr@4
    99
#endif
williamr@4
   100