require '_h2ph_pre.ph';

unless(defined(&_SPARC_STDARG_H_)) {
    eval 'sub _SPARC_STDARG_H_ () {1;}' unless defined(&_SPARC_STDARG_H_);
    require 'machine/ansi.ph';
    if(defined(&__lint__)) {
	eval 'sub __extension__ {
	    local($x) = @_;
    	    eval q((0));
	}' unless defined(&__extension__);
	eval 'sub __builtin_classify_type {
	    local($t) = @_;
    	    eval q((0));
	}' unless defined(&__builtin_classify_type);
    }
    eval 'sub __va_size {
        local($type) = @_;
	    eval q(((($sizeof{$type} + $sizeof{\'long\'} - 1) / $sizeof{\'long\'}) * $sizeof{\'long\'}));
    }' unless defined(&__va_size);
    if((defined(&__GNUC__) ? &__GNUC__ : 0) > 2|| (defined(&__GNUC_MINOR__) ? &__GNUC_MINOR__ : 0) >= 6) {
	eval 'sub va_start {
	    local($ap, $last) = @_;
    	    eval q(( &__builtin_next_arg, =  &__builtin_saveregs()));
	}' unless defined(&va_start);
    } else {
	eval 'sub va_start {
	    local($ap, $last) = @_;
    	    eval q(( &__builtin_next_arg(), =  &__builtin_saveregs()));
	}' unless defined(&va_start);
    }
    if((defined(&__GNUC__) ? &__GNUC__ : 0) == 1) {
	eval 'sub __extension__ () {1;}' unless defined(&__extension__);
    }
    eval 'sub __va_8byte {
        local($ap, $type) = @_;
	    eval q( &__extension__ ({  &union { \'char\'  $__d[ &sizeof]; \'int\'  $__i[2]; }  &__va_u;  ($__va_u->{__i[0]}) = ()[0];  ($__va_u->{__i[1]}) = ()[1]; += 8; * ($__va_u->{__d}); }));
    }' unless defined(&__va_8byte);
    eval 'sub __va_arg {
        local($ap, $type) = @_;
	    eval q((*(($ap) +=  &__va_size($type), ($ap) - ($sizeof{$type} < $sizeof{\'long\'}  && $sizeof{$type} !=  &__va_size($type) ? $sizeof{$type} :  &__va_size($type)))));
    }' unless defined(&__va_arg);
    eval 'sub __RECORD_TYPE_CLASS () {12;}' unless defined(&__RECORD_TYPE_CLASS);
    eval 'sub va_arg {
        local($ap, $type) = @_;
	    eval q(( &__builtin_classify_type(*0) >=  &__RECORD_TYPE_CLASS ? * &__va_arg($ap, $type *) :  &__va_size($type) == 8?  &__va_8byte($ap, $type) :  &__va_arg($ap, $type)));
    }' unless defined(&va_arg);
    eval 'sub va_end {
        local($ap) = @_;
	    eval q((0));
    }' unless defined(&va_end);
}
1;
