#ifndef GCC_4_FI_H
#define GCC_4_FI_H

#define __complex__

typedef void * __builtin_va_list;
#define __builtin_va_start(ap, parmN)	((void)((ap)= &(parmN)))
#define __builtin_va_arg(ap, type)	(*(type*)(ap))
#define __builtin_va_end(ap)		((void)((ap)=0))
#define __builtin_va_copy(d,s)

double __builtin_acos(double);
float __builtin_acosf(float);
double __builtin_acosh(double);
float __builtin_acoshf(float);
long double __builtin_acoshl(long double);
long double __builtin_acosl(long double);
double __builtin_asin(double);
float __builtin_asinf(float);
double __builtin_asinh(double);
float __builtin_asinhf(float);
long double __builtin_asinhl(long double);
long double __builtin_asinl(long double);
double __builtin_atan(double);
double __builtin_atan2(double,double);
float __builtin_atan2f(float,float);
long double __builtin_atan2l(long double, long double);
float __builtin_atanf(float);
double __builtin_atanh(double);
float __builtin_atanhf(float);
long double __builtin_atanhl(long double);
long double __builtin_atanl(long double);
double __builtin_cbrt(double);
float __builtin_cbrtf(float);
long double __builtin_cbrtl(long double);
double __builtin_ceil(double);
float __builtin_ceilf(float);
long double __builtin_ceill(long double);
double __builtin_copysign(double,double);
float __builtin_copysignf(float,float);
long double __builtin_copysignl(long double, long double);
double __builtin_cos(double);
float __builtin_cosf(float);
double __builtin_cosh(double);
float __builtin_coshf(float);
long double __builtin_coshl(long double);
long double __builtin_cosl(long double);
double __builtin_drem(double,double);
float __builtin_dremf(float,float);
long double __builtin_dreml(long double, long double);
double __builtin_erf(double);
double __builtin_erfc(double);
float __builtin_erfcf(float);
long double __builtin_erfcl(long double);
float __builtin_erff(float);
long double __builtin_erfl(long double);
void __builtin__exit(int);
void __builtin__Exit(int);
double __builtin_exp(double);
double __builtin_exp10(double);
float __builtin_exp10f(float);
long double __builtin_exp10l(long double);
double __builtin_exp2(double);
float __builtin_exp2f(float);
long double __builtin_exp2l(long double);
float __builtin_expf(float);
long double __builtin_expl(long double);
double __builtin_expm1(double);
float __builtin_expm1f(float);
long double __builtin_expm1l(long double);
double __builtin_fabs(double);
float __builtin_fabsf(float);
long double __builtin_fabsl(long double);
double __builtin_fdim(double,double);
float __builtin_fdimf(float,float);
long double __builtin_fdiml(long double, long double);
double __builtin_floor(double);
float __builtin_floorf(float);
long double __builtin_floorl(long double);
double __builtin_fma(double,double,double);
float __builtin_fmaf(float,float,float);
long double __builtin_fmal(long double, long double, long double);
double __builtin_fmax(double,double);
float __builtin_fmaxf(float,float);
long double __builtin_fmaxl(long double, long double);
double __builtin_fmin(double,double);
float __builtin_fminf(float,float);
long double __builtin_fminl(long double, long double);
double __builtin_fmod(double,double);
float __builtin_fmodf(float,float);
long double __builtin_fmodl(long double, long double);
double __builtin_frexp(double,int*);
float __builtin_frexpf(float,int*);
long double __builtin_frexpl(long double, int*);
double __builtin_gamma(double);
float __builtin_gammaf(float);
long double __builtin_gammal(long double);
double __builtin_huge_val();
float __builtin_huge_valf();
long double __builtin_huge_vall();
double __builtin_hypot(double,double);
float __builtin_hypotf(float,float);
long double __builtin_hypotl(long double, long double);
int __builtin_ilogb(double);
int __builtin_ilogbf(float);
int __builtin_ilogbl(long double);
double __builtin_inf();
float __builtin_inff();
long double __builtin_infl();
int __builtin_isfinite(double);
double __builtin_j0(double);
float __builtin_j0f(float);
long double __builtin_j0l(long double);
double __builtin_j1(double);
float __builtin_j1f(float);
long double __builtin_j1l(long double);
double __builtin_jn(int,double);
float __builtin_jnf(int,float);
long double __builtin_jnl(int, long double);
double __builtin_ldexp(double,int);
float __builtin_ldexpf(float,int);
long double __builtin_ldexpl(long double, int);
double __builtin_lgamma(double);
float __builtin_lgammaf(float);
long double __builtin_lgammal(long double);
long long int __builtin_llrint(double);
long long int __builtin_llrintf(float);
long long int __builtin_llrintl(long double);
long long int __builtin_llround(double);
long long int __builtin_llroundf(float);
long long int __builtin_llroundl(long double);
double __builtin_log(double);
double __builtin_log10(double);
float __builtin_log10f(float);
long double __builtin_log10l(long double);
double __builtin_log1p(double);
float __builtin_log1pf(float);
long double __builtin_log1pl(long double);
double __builtin_log2(double);
float __builtin_log2f(float);
long double __builtin_log2l(long double);
double __builtin_logb(double);
float __builtin_logbf(float);
long double __builtin_logbl(long double);
float __builtin_logf(float);
long double __builtin_logl(long double);
double __complex__ __builtin_clog(double __complex__);
float __complex__ __builtin_clogf(float __complex__);
long double __complex__ __builtin_clogl(long double __complex__);
long int __builtin_lrint(double);
long int __builtin_lrintf(float);
long int __builtin_lrintl(long double);
long int __builtin_lround(double);
long int __builtin_lroundf(float);
long int __builtin_lroundl(long double);
double __builtin_modf(double,double*);
float __builtin_modff(float,float*);
long double __builtin_modfl(long double, long double*);
double __builtin_nan(const char*);
float __builtin_nanf(const char*);
long double __builtin_nanl(const char*);
double __builtin_nans(const char*);
float __builtin_nansf(const char*);
long double __builtin_nansl(const char*);
double __builtin_nearbyint(double);
float __builtin_nearbyintf(float);
long double __builtin_nearbyintl(long double);
double __builtin_nextafter(double,double);
float __builtin_nextafterf(float,float);
long double __builtin_nextafterl(long double, long double);
double __builtin_nexttoward(double, long double);
float __builtin_nexttowardf(float, long double);
long double __builtin_nexttowardl(long double, long double);
double __builtin_pow(double,double);
double __builtin_pow10(double);
float __builtin_pow10f(float);
long double __builtin_pow10l(long double);
double __builtin_powi(double, int);
float __builtin_powf(float,float);
float __builtin_powif(float,int);
long double __builtin_powl(long double, long double);
long double __builtin_powil(long double,int);
double __builtin_remainder(double,double);
float __builtin_remainderf(float,float);
long double __builtin_remainderl(long double, long double);
double __builtin_remquo(double,double,int*);
float __builtin_remquof(float,float,int*);
long double __builtin_remquol(long double, long double, int*);
double __builtin_rint(double);
float __builtin_rintf(float);
long double __builtin_rintl(long double);
double __builtin_round(double);
float __builtin_roundf(float);
long double __builtin_roundl(long double);
double __builtin_scalb(double,double);
float __builtin_scalbf(float,float);
long double __builtin_scalbl(long double, long double);
double __builtin_scalbln(double, long int);
float __builtin_scalblnf(float, long int);
long double __builtin_scalblnl(long double, long int);
double __builtin_scalbn(double,int);
float __builtin_scalbnf(float,int);
long double __builtin_scalbnl(long double, int);
int __builtin_signbit (double);
double __builtin_significand(double);
float __builtin_significandf(float);
long double __builtin_significandl(long double);
double __builtin_sin(double);
void __builtin_sincos(double,double*,double*);
void __builtin_sincosf(float,float*,float*);
void __builtin_sincosl(long double, long double*, long double*);
float __builtin_sinf(float);
double __builtin_sinh(double);
float __builtin_sinhf(float);
long double __builtin_sinhl(long double);
long double __builtin_sinl(long double);
double __builtin_sqrt(double);
float __builtin_sqrtf(float);
long double __builtin_sqrtl(long double);
double __builtin_tan(double);
float __builtin_tanf(float);
double __builtin_tanh(double);
float __builtin_tanhf(float);
long double __builtin_tanhl(long double);
long double __builtin_tanl(long double);
double __builtin_tgamma(double);
float __builtin_tgammaf(float);
long double __builtin_tgammal(long double);
double __builtin_trunc(double);
float __builtin_truncf(float);
long double __builtin_truncl(long double);
double __builtin_y0(double);
float __builtin_y0f(float);
long double __builtin_y0l(long double);
double __builtin_y1(double);
float __builtin_y1f(float);
long double __builtin_y1l(long double);
double __builtin_yn(int,double);
float __builtin_ynf(int,float);
long double __builtin_ynl(int, long double);
double __builtin_cabs(double __complex__);
float __builtin_cabsf(float __complex__);
long double __builtin_cabsl(long double __complex__);
double __complex__ __builtin_cacos(double __complex__);
float __complex__ __builtin_cacosf(float __complex__);
double __complex__ __builtin_cacosh(double __complex__);
float __complex__ __builtin_cacoshf(float __complex__);
long double __complex__ __builtin_cacoshl(long double __complex__);
long double __complex__ __builtin_cacosl(long double __complex__);
double __builtin_carg(double __complex__);
float __builtin_cargf(float __complex__);
long double __builtin_cargl(long double __complex__);
double __complex__ __builtin_casin(double __complex__);
float __complex__ __builtin_casinf(float __complex__);
double __complex__ __builtin_casinh(double __complex__);
float __complex__ __builtin_casinhf(float __complex__);
long double __complex__ __builtin_casinhl(long double __complex__);
long double __complex__ __builtin_casinl(long double __complex__);
double __complex__ __builtin_catan(double __complex__);
float __complex__ __builtin_catanf(float __complex__);
double __complex__ __builtin_catanh(double __complex__);
float __complex__ __builtin_catanhf(float __complex__);
long double __complex__ __builtin_catanhl(long double __complex__);
long double __complex__ __builtin_catanl(long double __complex__);
double __complex__ __builtin_ccos(double __complex__);
float __complex__ __builtin_ccosf(float __complex__);
double __complex__ __builtin_ccosh(double __complex__);
float __complex__ __builtin_ccoshf(float __complex__);
long double __complex__ __builtin_ccoshl(long double __complex__);
long double __complex__ __builtin_ccosl(long double __complex__);
double __complex__ __builtin_cexp(double __complex__);
float __complex__ __builtin_cexpf(float __complex__);
long double __complex__ __builtin_cexpl(long double __complex__);
double __builtin_cimag(double __complex__);
float __builtin_cimagf(float __complex__);
long double __builtin_cimagl(long double __complex__);
double __complex__ __builtin_conj(double __complex__);
float __complex__ __builtin_conjf(float __complex__);
long double __complex__ __builtin_conjl(long double __complex__);
double __complex__ __builtin_cpow(double __complex__, double __complex__);
float __complex__ __builtin_cpowf(float __complex__, float __complex__);
long double __complex__ __builtin_cpowl(long double __complex__, long double __complex__);
double __complex__ __builtin_cproj(double __complex__);
float __complex__ __builtin_cprojf(float __complex__);
long double __complex__ __builtin_cprojl(long double __complex__);
double __builtin_creal(double __complex__);
float __builtin_crealf(float __complex__);
long double __builtin_creall(long double __complex__);
double __complex__ __builtin_csin(double __complex__);
float __complex__ __builtin_csinf(float __complex__);
double __complex__ __builtin_csinh(double __complex__);
float __complex__ __builtin_csinhf(float __complex__);
long double __complex__ __builtin_csinhl(long double __complex__);
long double __complex__ __builtin_csinl(long double __complex__);
double __complex__ __builtin_csqrt(double __complex__);
float __complex__ __builtin_csqrtf(float __complex__);
long double __complex__ __builtin_csqrtl(long double __complex__);
double __complex__ __builtin_ctan(double __complex__);
float __complex__ __builtin_ctanf(float __complex__);
double __complex__ __builtin_ctanh(double __complex__);
float __complex__ __builtin_ctanhf(float __complex__);
long double __complex__ __builtin_ctanhl(long double __complex__);
long double __complex__ __builtin_ctanl(long double __complex__);
int __builtin_bcmp(const void*, const void*, unsigned int);
void __builtin_bcopy(const void*, void*, unsigned int);
void __builtin_bzero(void*, unsigned int);
int __builtin_ffs(int);
int __builtin_ffsl(long int);
int __builtin_ffsll(long long int);
char* __builtin_index(const char*, int);
int __builtin_memcmp(const void*,const void*,unsigned int);
void* __builtin_memcpy(void*, const void*, unsigned int);
void* __builtin_memmove(void*, const void*, unsigned int);
void* __builtin_mempcpy(void*, const void*, unsigned int);
void* __builtin_memset(void*, int, unsigned int);
void* __builtin_memchr(const void*,int,unsigned int);
char* __builtin_rindex(const char*,int);
char* __builtin_stpcpy(char*, const char*);
char* __builtin_strcat(char*, const char*);
char* __builtin_strchr(const char*,int);
int __builtin_strcmp(const char*,const char*);
char* __builtin_strcpy(char*, const char*);
unsigned int __builtin_strcspn(const char*,const char*);
char* __builtin_strdup(const char*);
unsigned int __builtin_strlen(const char*);
char* __builtin_strncat(char*, const char*, unsigned int);
int __builtin_strncmp(const char*,const char*,unsigned int);
char* __builtin_strncpy(char*, const char*, unsigned int);
char* __builtin_strpbrk(const char*,const char*);
char* __builtin_strrchr(const char*,int);
unsigned int __builtin_strspn(const char*,const char*);
char* __builtin_strstr(const char*,const char*);
int __builtin_fpclassify (int, int, int, int, int, ...);
int __builtin_fprintf(void*, const char*, ...);
int __builtin_fprintf_unlocked(void*, const char*, ...);
int __builtin_fputc(int, void*);
int __builtin_fputc_unlocked(int, void*);
int __builtin_fputs(const char*, void*);
int __builtin_fputs_unlocked(const char*, void*);
int __builtin_fscanf(void*, const char*, ...);
unsigned int __builtin_fwrite(const void*, unsigned int, unsigned int, void*);
unsigned int __builtin_fwrite_unlocked(const void*, unsigned int, unsigned int, void*);
int __builtin_printf(const char*, ...);
int __builtin_printf_unlocked(const char*, ...);
int __builtin_putchar(int);
int __builtin_putchar_unlocked(int);
int __builtin_puts(const char*);
int __builtin_puts_unlocked(const char*);
int __builtin_scanf(const char*, ...);
int __builtin_snprintf(char*, unsigned int, const char*, ...);
int __builtin_sprintf(char*, const char*, ...);
int __builtin_sscanf(const char*,const char*, ...);
int __builtin_vfprintf(void*, const char*, char*);
int __builtin_vfscanf(void*, const char*, char*);
int __builtin_vprintf(const char*, char*);
int __builtin_vscanf(const char*, char*);
int __builtin_vsnprintf(char*, unsigned int, const char*, __builtin_va_list);
int __builtin_vsprintf(char*,const char*,__builtin_va_list);
int __builtin_vsscanf(const char*, const char*, char*);
void __builtin_abort();
int __builtin_abs(int);
void* __builtin_aggregate_incoming_address(...);
void* __builtin_alloca(unsigned int);
void* __builtin_apply(void (*)(...), void*, unsigned int);
void* __builtin_apply_args(...);
int __builtin_args_info(int);
void* __builtin_calloc(unsigned int, unsigned int);
int __builtin_classify_type(...);
int __builtin_clz(unsigned int);
int __builtin_clzl(long unsigned int);
int __builtin_clzll(long long unsigned int);
int __builtin_constant_p(...);
int __builtin_ctz(unsigned int);
int __builtin_ctzl(long unsigned int);
int __builtin_ctzll(long long unsigned int);
char* __builtin_dcgettext(const char*,const char*,int);
char* __builtin_dgettext(const char*,const char*);
void* __builtin_dwarf_cfa();
unsigned int __builtin_dwarf_sp_column();
void __builtin___builtin_eh_return(int,const char*);
int __builtin_eh_return_data_regno(int);
void __builtin_exit(int);
long __builtin_expect(long,long);
void* __builtin_extract_return_addr(void*);
void* __builtin_frame_address(unsigned int);
void* __builtin_frob_return_addr(void*);
char* __builtin_gettext(const char*);
long long int __builtin_imaxabs(long long int);
void __builtin_init_dwarf_reg_size_table(void*);
int __builtin_isgreater(...);
int __builtin_isgreaterequal(...);
int __builtin_isless(...);
int __builtin_islessequal(...);
int __builtin_islessgreater(...);
int __builtin_isunordered(...);
long int __builtin_labs(long int);
long long int __builtin_llabs(long long int);
void __builtin_longjmp(void*, int);
void* __builtin_malloc(unsigned int);
void* __builtin_next_arg(...);
int __builtin_parity(unsigned int);
int __builtin_parityl(long unsigned int);
int __builtin_parityll(long long unsigned int);
int __builtin_popcount(unsigned int);
int __builtin_popcountl(long unsigned int);
int __builtin_popcountll(long long unsigned int);
void __builtin_prefetch(const void*, ...);
void __builtin_return(void*);
void* __builtin_return_address(unsigned int);
void* __builtin_saveregs(...);
int __builtin_setjmp(void*);
int __builtin_strfmon(char*, unsigned int, const char*, ...);
unsigned int __builtin_strftime(char*, unsigned int, const char*, const void*);
void __builtin_trap();
void __builtin_unwind_init();
void __sync_fetch_and_add(...);
void __sync_fetch_and_sub(...);
void __sync_fetch_and_or(...);
void __sync_fetch_and_and(...);
void __sync_fetch_and_xor(...);
void __sync_fetch_and_nand(...);
void __sync_add_and_fetch(...);
void __sync_sub_and_fetch(...);
void __sync_or_and_fetch(...);
void __sync_and_and_fetch(...);
void __sync_xor_and_fetch(...);
void __sync_nand_and_fetch(...);
void __sync_bool_compare_and_swap(...);
void __sync_val_compare_and_swap(...);
void __sync_synchronize (...);
int __sync_lock_test_and_set(...);
void __sync_lock_release (...);

#undef __complex__

/* CR-14578 */
#define __builtin_offsetof(type, member) (sizeof (type) - sizeof (type::member))
//#define __builtin_offsetof(type, member) ((size_t) ((char *) &((type *) 0)->member - (char *) 0))

/* CR-15557 statement expressions */
#define sigsetjmp sigsetjmp
#define siglongjmp siglongjmp
template <typename SIGJMP_BUF> extern int sigsetjmp (SIGJMP_BUF, int);
template <typename SIGJMP_BUF> extern void siglongjmp (SIGJMP_BUF, int);

#define __FD_ISSET(fd, fdsp) ((fd)!=0)

extern "C" void* memset(void*,int,unsigned int);
#define FD_ZERO(p) memset((p),0,sizeof(*(p)))

#define __WAIT_INT(status) (status)

/* MINGW32 fix */
#ifdef __MINGW32__
#define _fileno(__F) ((__F)->_file)
#endif

/* These types are defined using __attributes__ and so end up being
 * different to 'float' and 'double'. */
typedef volatile float __m128;
typedef volatile double __m128d;
typedef volatile int __m128i;

/* Atomics */
typedef int _Atomic_word ;
_Atomic_word __atomic_fetch_add ( volatile _Atomic_word * , int, int ) ;

/* Macro to determine if something is trivial or not */
#define __is_trivial(T) false

#endif
