os/kernelhwsrv/kernel/eka/include/gcc.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/include/gcc.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,100 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32\include\gcc.h
    1.18 +// This is a preinclude file for GCC compilers. Currently only tested with GCC 3.4.4.
    1.19 +// 
    1.20 +//
    1.21 +
    1.22 +/**
    1.23 + @file
    1.24 + @internalAll
    1.25 +*/
    1.26 +
    1.27 +// Check this header is being used as anticipated
    1.28 +#ifndef __GCC32__
    1.29 +#error Unexpected include of GCC header
    1.30 +#endif
    1.31 +#ifndef __X86__
    1.32 +#error GCC header untested on non-X86 platforms
    1.33 +#endif
    1.34 +
    1.35 +// Do product include if not done already
    1.36 +#ifdef PRODUCT_INCLUDE
    1.37 +#include PRODUCT_INCLUDE
    1.38 +#endif
    1.39 +
    1.40 +// Visibility
    1.41 +#define IMPORT_C
    1.42 +#define IMPORT_D __attribute__((dllimport))
    1.43 +#define EXPORT_C __attribute__((dllexport))
    1.44 +#define EXPORT_D 
    1.45 +#ifdef GCC4_OR_LATER // this would be nice... use in conjunction with -fvisibility=hidden
    1.46 +#undef  EXPORT_C
    1.47 +#define EXPORT_C __attribute__((visibility("default")))
    1.48 +#endif
    1.49 +
    1.50 +// Varargs
    1.51 +typedef __builtin_va_list va_list;
    1.52 +#define va_start(v, l) __builtin_va_start(v, l)
    1.53 +#define va_arg(v, l) __builtin_va_arg(v, l)
    1.54 +#define va_end(v) __builtin_va_end(v)
    1.55 +#define VA_LIST va_list
    1.56 +#define _VA_LIST_DEFINED //To deal with stdarg.h
    1.57 +#define __VA_LIST_defined //To deal with e32def.h
    1.58 +#define VA_START(ap,pn) va_start(ap, pn)
    1.59 +#define VA_ARG(ap,type) va_arg(ap,type)
    1.60 +#define VA_END(ap)      va_end(ap)
    1.61 +
    1.62 +// Stdlib/OpenEnv support
    1.63 +// This should prevent /stdlib/linc/stdarg.h from doing damage.
    1.64 +#define _STDARG_H
    1.65 +// now deal with stdarg_e.h
    1.66 +typedef va_list __e32_va_list;
    1.67 +#define _STDARG_E_H
    1.68 +// wchar_t is a primtive type for C++ on GCC
    1.69 +#ifdef __cplusplus
    1.70 +#define __wchar_t_defined
    1.71 +#endif
    1.72 +
    1.73 +// General
    1.74 +#define __NO_CLASS_CONSTS__
    1.75 +#define	I64LIT(x)	x##LL
    1.76 +#define	UI64LIT(x)	x##ULL
    1.77 +#define __SOFTFP
    1.78 +#define __NORETURN__  __attribute__ ((noreturn))
    1.79 +#define NONSHARABLE_CLASS(x) class /*__attribute__(notshared)*/ x
    1.80 +#define NONSHARABLE_STRUCT(x) struct /*__attribute__(notshared)*/ x
    1.81 +#define __NO_THROW //throw ()
    1.82 +#define __THROW(t) //throw (t)
    1.83 +#define TEMPLATE_SPECIALIZATION template<>
    1.84 +
    1.85 +#ifndef __cdecl
    1.86 +#define __cdecl __attribute__((cdecl))
    1.87 +#endif
    1.88 +#ifndef __fastcall
    1.89 +#define __fastcall __attribute__((fastcall))
    1.90 +#endif
    1.91 +#ifndef __stdcall
    1.92 +#define __stdcall __attribute__((stdcall))
    1.93 +#endif
    1.94 +
    1.95 +// These are built-in defines during compilation stage but are also required (and not defined) during makmake stage
    1.96 +#ifndef __GNUC__
    1.97 +#define __GNUC__ 3
    1.98 +#endif
    1.99 +
   1.100 +#ifndef __i386
   1.101 +#define __i386
   1.102 +#endif
   1.103 +