require '_h2ph_pre.ph';

unless(defined(&_WIN32)) {
    unless(defined(&__GNUC_VA_LIST)) {
	eval 'sub __GNUC_VA_LIST () {1;}' unless defined(&__GNUC_VA_LIST);
	unless(defined(&_SYS_VA_LIST_H)) {
	    eval 'sub _SYS_VA_LIST_H () {1;}' unless defined(&_SYS_VA_LIST_H);
	    eval 'sub __va_overflow {
	        local($AP) = @_;
    		eval q(($AP)-> &overflow_arg_area);
	    }' unless defined(&__va_overflow);
	} else {
	    eval 'sub __va_overflow {
	        local($AP) = @_;
    		eval q(($AP)-> &input_arg_area);
	    }' unless defined(&__va_overflow);
	}
    }
    if(defined ( &_STDARG_H) || defined ( &_VARARGS_H)) {
	unless(defined(&__VA_PPC_H__)) {
	    eval 'sub __VA_PPC_H__ () {1;}' unless defined(&__VA_PPC_H__);
	    eval 'sub __VA_FP_REGSAVE {
	        local($AP,$OFS,$TYPE) = @_;
    		eval q(( ((( ($AP)-> &reg_save_area)-> $__fp_save[$OFS]))));
	    }' unless defined(&__VA_FP_REGSAVE);
	    eval 'sub __VA_GP_REGSAVE {
	        local($AP,$OFS,$TYPE) = @_;
    		eval q(( ((( ($AP)-> &reg_save_area)-> $__gp_save[$OFS]))));
	    }' unless defined(&__VA_GP_REGSAVE);
	    eval 'sub __va_start_common {
	        local($AP, $FAKE) = @_;
    		eval q( &__extension__ ({ =  &__builtin_alloca($sizeof{ &__gnuc_va_list});  &__builtin_memcpy (($AP),  &__builtin_saveregs (), $sizeof{ &__gnuc_va_list}); }));
	    }' unless defined(&__va_start_common);
	    if(defined(&_STDARG_H)) {
		eval 'sub va_start {
		    local($AP,$LASTARG) = @_;
    		    eval q(( &__builtin_next_arg ($LASTARG),  &__va_start_common ($AP, 0)));
		}' unless defined(&va_start);
	    } else {
		eval 'sub va_start {
		    local($AP) = @_;
    		    eval q( &__va_start_common ($AP, 1));
		}' unless defined(&va_start);
		eval 'sub va_alist () { &__va_1st_arg;}' unless defined(&va_alist);
		eval 'sub va_dcl () { &register \'int\'  &va_alist; ...;}' unless defined(&va_dcl);
	    }
	    if(defined(&_SOFT_FLOAT)) {
		eval 'sub __va_float_p {
		    local($TYPE) = @_;
    		    eval q(0);
		}' unless defined(&__va_float_p);
	    } else {
		eval 'sub __va_float_p {
		    local($TYPE) = @_;
    		    eval q(( &__builtin_classify_type(*0) == 8));
		}' unless defined(&__va_float_p);
	    }
	    eval 'sub __va_aggregate_p {
	        local($TYPE) = @_;
    		eval q(( &__builtin_classify_type(*0) >= 12));
	    }' unless defined(&__va_aggregate_p);
	    eval 'sub __va_size {
	        local($TYPE) = @_;
    		eval q((($sizeof{$TYPE} + $sizeof{\'long\'} - 1) / $sizeof{\'long\'}));
	    }' unless defined(&__va_size);
	    if(defined(&__OPTIMIZE__)) {
	    } else {
		eval 'sub __va_arg_type_violation () {
		    eval q();
		}' unless defined(&__va_arg_type_violation);
	    }
	    eval 'sub va_arg {
	        local($AP,$TYPE) = @_;
    		eval q( &__extension__ (*({  &register $TYPE * &__ptr;  &if ( &__va_float_p  &&  &sizeof < 16) { \'unsigned char __fpr\' = -> &fpr;  &if ( &__fpr < 8) {  &__ptr =  &__VA_FP_REGSAVE ($AP,  &__fpr, $TYPE); -> &fpr =  &__fpr + 1; }  &else  &if ( &sizeof == 8) { \'unsigned long __addr\' = ;  &__ptr = (( &__addr + 7) & -8);  &__va_overflow = ( &__ptr + 1); }  &else {  &__va_arg_type_violation (); } }  &else  &if ( &__va_aggregate_p ||  &__va_float_p ) { \'unsigned char __gpr\' = -> &gpr;  &if ( &__gpr < 8) {  &__ptr = *  &__VA_GP_REGSAVE ($AP,  &__gpr, $TYPE *); -> &gpr =  &__gpr + 1; }  &else { $TYPE ** &__pptr = ;  &__ptr = *  &__pptr;  &__va_overflow = ( &__pptr + 1); } }  &else {  &if ( &sizeof == 8) { \'unsigned char __gpr\' = -> &gpr;  &if ( &__gpr < 7) {  &__gpr +=  &__gpr & 1;  &__ptr =  &__VA_GP_REGSAVE ($AP,  &__gpr, $TYPE); -> &gpr =  &__gpr + 2; }  &else { \'unsigned long __addr\' = ;  &__ptr = (( &__addr + 7) & -8); -> &gpr = 8;  &__va_overflow = ( &__ptr + 1); } }  &else  &if ( &sizeof == 4) { \'unsigned char __gpr\' = -> &gpr;  &if ( &__gpr < 8) {  &__ptr =  &__VA_GP_REGSAVE ($AP,  &__gpr, $TYPE); -> &gpr =  &__gpr + 1; }  &else {  &__ptr =  &__va_overflow ;  &__va_overflow = ( &__ptr + 1); } }  &else {  &__va_arg_type_violation (); } }  &__ptr; })));
	    }' unless defined(&va_arg);
	    eval 'sub va_end {
	        local($AP) = @_;
    		eval q((0));
	    }' unless defined(&va_end);
	    if(!defined( &_ANSI_SOURCE)  && (!defined( &_POSIX_C_SOURCE)  && !defined( &_XOPEN_SOURCE) || defined( &_ISOC99_SOURCE) || ((defined(&__STDC_VERSION__) ? &__STDC_VERSION__ : 0) - 0) >= 199901)) {
		eval 'sub va_copy {
		    local($dest, $src) = @_;
    		    eval q( &__extension__ ({ =  &__builtin_alloca($sizeof{ &__gnuc_va_list}); *($dest) = *($src); }));
		}' unless defined(&va_copy);
	    }
	    eval 'sub __va_copy {
	        local($dest, $src) = @_;
    		eval q( &__extension__ ({ =  &__builtin_alloca($sizeof{ &__gnuc_va_list}); *($dest) = *($src); }));
	    }' unless defined(&__va_copy);
	}
    }
} else {
    unless(defined(&__GNUC_VA_LIST)) {
	eval 'sub __GNUC_VA_LIST () {1;}' unless defined(&__GNUC_VA_LIST);
    }
    if(defined ( &_STDARG_H) || defined ( &_VARARGS_H)) {
	eval 'sub __va_start_common {
	    local($AP, $LASTARG, $FAKE) = @_;
    	    eval q((( &__builtin_saveregs ()), (($AP) = ( $LASTARG) +  &__va_rounded_size ($AP)), 0));
	}' unless defined(&__va_start_common);
	if(defined(&_STDARG_H)) {
	    eval 'sub va_start {
	        local($AP,$LASTARG) = @_;
    		eval q(( &__builtin_saveregs (), ($AP) =  &__builtin_next_arg ($LASTARG), 0));
	    }' unless defined(&va_start);
	} else {
	    eval 'sub va_start {
	        local($AP) = @_;
    		eval q(( &__builtin_saveregs (), ($AP) =  &__builtin_next_arg ( &__va_1st_arg) - $sizeof{\'int\'}, 0));
	    }' unless defined(&va_start);
	    eval 'sub va_alist () { &__va_1st_arg;}' unless defined(&va_alist);
	    eval 'sub va_dcl () { &register \'int\'  &__va_1st_arg; ...;}' unless defined(&va_dcl);
	}
	eval 'sub __va_rounded_size {
	    local($TYPE) = @_;
    	    eval q((($sizeof{$TYPE} + 3) & ~3));
	}' unless defined(&__va_rounded_size);
	eval 'sub __va_align {
	    local($AP, $TYPE) = @_;
    	    eval q((((($AP)) + (($sizeof{$TYPE} >= 8) ? 7: 3)) & ~(($sizeof{$TYPE} >= 8) ? 7: 3)));
	}' unless defined(&__va_align);
	eval 'sub va_arg {
	    local($AP,$TYPE) = @_;
    	    eval q(( *(($AP = ( &__va_align($AP, $TYPE) +  &__va_rounded_size($TYPE))) -  &__va_rounded_size($TYPE))));
	}' unless defined(&va_arg);
	eval 'sub va_end {
	    local($AP) = @_;
    	    eval q((0));
	}' unless defined(&va_end);
	eval 'sub __va_copy {
	    local($dest, $src) = @_;
    	    eval q(($dest) = ($src));
	}' unless defined(&__va_copy);
    }
}
1;
