williamr@4: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@4: // All rights reserved. williamr@4: // This component and the accompanying materials are made available williamr@4: // under the terms of the License "Eclipse Public License v1.0" williamr@4: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: // williamr@4: // Initial Contributors: williamr@4: // Nokia Corporation - initial contribution. williamr@4: // williamr@4: // Contributors: williamr@4: // williamr@4: // Description: williamr@4: // e32\include\gcc.h williamr@4: // This is a preinclude file for GCC compilers. Currently only tested with GCC 3.4.4. williamr@4: // williamr@4: // williamr@4: williamr@4: /** williamr@4: @file williamr@4: @internalAll williamr@4: */ williamr@4: williamr@4: // Check this header is being used as anticipated williamr@4: #ifndef __GCC32__ williamr@4: #error Unexpected include of GCC header williamr@4: #endif williamr@4: #ifndef __X86__ williamr@4: #error GCC header untested on non-X86 platforms williamr@4: #endif williamr@4: williamr@4: // Do product include if not done already williamr@4: #ifdef PRODUCT_INCLUDE williamr@4: #include PRODUCT_INCLUDE williamr@4: #endif williamr@4: williamr@4: // Visibility williamr@4: #define IMPORT_C williamr@4: #define IMPORT_D __attribute__((dllimport)) williamr@4: #define EXPORT_C __attribute__((dllexport)) williamr@4: #define EXPORT_D williamr@4: #ifdef GCC4_OR_LATER // this would be nice... use in conjunction with -fvisibility=hidden williamr@4: #undef EXPORT_C williamr@4: #define EXPORT_C __attribute__((visibility("default"))) williamr@4: #endif williamr@4: williamr@4: // Varargs williamr@4: typedef __builtin_va_list va_list; williamr@4: #define va_start(v, l) __builtin_va_start(v, l) williamr@4: #define va_arg(v, l) __builtin_va_arg(v, l) williamr@4: #define va_end(v) __builtin_va_end(v) williamr@4: #define VA_LIST va_list williamr@4: #define _VA_LIST_DEFINED //To deal with stdarg.h williamr@4: #define __VA_LIST_defined //To deal with e32def.h williamr@4: #define VA_START(ap,pn) va_start(ap, pn) williamr@4: #define VA_ARG(ap,type) va_arg(ap,type) williamr@4: #define VA_END(ap) va_end(ap) williamr@4: williamr@4: // Stdlib/OpenEnv support williamr@4: // This should prevent /stdlib/linc/stdarg.h from doing damage. williamr@4: #define _STDARG_H williamr@4: // now deal with stdarg_e.h williamr@4: typedef va_list __e32_va_list; williamr@4: #define _STDARG_E_H williamr@4: // wchar_t is a primtive type for C++ on GCC williamr@4: #ifdef __cplusplus williamr@4: #define __wchar_t_defined williamr@4: #endif williamr@4: williamr@4: // General williamr@4: #define __NO_CLASS_CONSTS__ williamr@4: #define I64LIT(x) x##LL williamr@4: #define UI64LIT(x) x##ULL williamr@4: #define __SOFTFP williamr@4: #define __NORETURN__ __attribute__ ((noreturn)) williamr@4: #define NONSHARABLE_CLASS(x) class /*__attribute__(notshared)*/ x williamr@4: #define NONSHARABLE_STRUCT(x) struct /*__attribute__(notshared)*/ x williamr@4: #define __NO_THROW //throw () williamr@4: #define __THROW(t) //throw (t) williamr@4: #define TEMPLATE_SPECIALIZATION template<> williamr@4: williamr@4: #ifndef __cdecl williamr@4: #define __cdecl __attribute__((cdecl)) williamr@4: #endif williamr@4: #ifndef __fastcall williamr@4: #define __fastcall __attribute__((fastcall)) williamr@4: #endif williamr@4: #ifndef __stdcall williamr@4: #define __stdcall __attribute__((stdcall)) williamr@4: #endif williamr@4: williamr@4: // These are built-in defines during compilation stage but are also required (and not defined) during makmake stage williamr@4: #ifndef __GNUC__ williamr@4: #define __GNUC__ 3 williamr@4: #endif williamr@4: williamr@4: #ifndef __i386 williamr@4: #define __i386 williamr@4: #endif williamr@4: