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