First public contribution.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
15 // This is a preinclude file for GCC compilers. Currently only tested with GCC 3.4.4.
24 // Check this header is being used as anticipated
26 #error Unexpected include of GCC header
29 #error GCC header untested on non-X86 platforms
32 // Do product include if not done already
33 #ifdef PRODUCT_INCLUDE
34 #include PRODUCT_INCLUDE
39 #define IMPORT_D __attribute__((dllimport))
40 #define EXPORT_C __attribute__((dllexport))
42 #ifdef GCC4_OR_LATER // this would be nice... use in conjunction with -fvisibility=hidden
44 #define EXPORT_C __attribute__((visibility("default")))
48 typedef __builtin_va_list va_list;
49 #define va_start(v, l) __builtin_va_start(v, l)
50 #define va_arg(v, l) __builtin_va_arg(v, l)
51 #define va_end(v) __builtin_va_end(v)
52 #define VA_LIST va_list
53 #define _VA_LIST_DEFINED //To deal with stdarg.h
54 #define __VA_LIST_defined //To deal with e32def.h
55 #define VA_START(ap,pn) va_start(ap, pn)
56 #define VA_ARG(ap,type) va_arg(ap,type)
57 #define VA_END(ap) va_end(ap)
59 // Stdlib/OpenEnv support
60 // This should prevent /stdlib/linc/stdarg.h from doing damage.
62 // now deal with stdarg_e.h
63 typedef va_list __e32_va_list;
65 // wchar_t is a primtive type for C++ on GCC
67 #define __wchar_t_defined
71 #define __NO_CLASS_CONSTS__
72 #define I64LIT(x) x##LL
73 #define UI64LIT(x) x##ULL
75 #define __NORETURN__ __attribute__ ((noreturn))
76 #define NONSHARABLE_CLASS(x) class /*__attribute__(notshared)*/ x
77 #define NONSHARABLE_STRUCT(x) struct /*__attribute__(notshared)*/ x
78 #define __NO_THROW //throw ()
79 #define __THROW(t) //throw (t)
80 #define TEMPLATE_SPECIALIZATION template<>
83 #define __cdecl __attribute__((cdecl))
86 #define __fastcall __attribute__((fastcall))
89 #define __stdcall __attribute__((stdcall))
92 // These are built-in defines during compilation stage but are also required (and not defined) during makmake stage