require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_SYS_CDEFS_AOUT_H_)) {
    eval 'sub _SYS_CDEFS_AOUT_H_ () {1;}' unless defined(&_SYS_CDEFS_AOUT_H_);
    eval 'sub _C_LABEL {
        my($x) = @_;
	    eval q( &__CONCAT( &_,$x));
    }' unless defined(&_C_LABEL);
    eval 'sub _C_LABEL_STRING {
        my($x) = @_;
	    eval q(\\"_\\"$x);
    }' unless defined(&_C_LABEL_STRING);
    if((defined(&__STDC__) ? &__STDC__ : undef)) {
	eval 'sub ___RENAME {
	    my($x) = @_;
    	    eval q( &__asm( &___STRING( &_C_LABEL($x))));
	}' unless defined(&___RENAME);
    } else {
	eval 'sub ___RENAME {
	    my($x) = @_;
    	    eval q( &____RENAME( &_ $x));
	}' unless defined(&___RENAME);
	eval 'sub ____RENAME {
	    my($x) = @_;
    	    eval q( &__asm( &___STRING($x)));
	}' unless defined(&____RENAME);
    }
    eval 'sub __indr_reference {
        my($sym,$alias) = @_;
	    eval q();
    }' unless defined(&__indr_reference);
    if(defined(&__GNUC__)) {
	if((defined(&__STDC__) ? &__STDC__ : undef)) {
	    eval 'sub __strong_alias {
	        my($alias,$sym) = @_;
    		eval q( &__asm(\\".global \\"  &_C_LABEL_STRING($alias) \\"\\\\n\\"  &_C_LABEL_STRING($alias) \\" = \\"  &_C_LABEL_STRING($sym)););
	    }' unless defined(&__strong_alias);
	    eval 'sub __weak_alias {
	        my($alias,$sym) = @_;
    		eval q( &__asm(\\".weak \\"  &_C_LABEL_STRING($alias) \\"\\\\n\\"  &_C_LABEL_STRING($alias) \\" = \\"  &_C_LABEL_STRING($sym)););
	    }' unless defined(&__weak_alias);
	    eval 'sub __weak_extern {
	        my($sym) = @_;
    		eval q( &__asm(\\".weak \\"  &_C_LABEL_STRING($sym)););
	    }' unless defined(&__weak_extern);
	    if( &__GNUC_PREREQ__(4, 0)) {
		eval 'sub __weak_reference {
		    my($sym) = @_;
    		    eval q( &__attribute__(( &__weakref__)));
		}' unless defined(&__weak_reference);
	    } else {
		eval 'sub __weak_reference {
		    my($sym) = @_;
    		    eval q(;  &__asm(\\".weak \\"  &_C_LABEL_STRING($sym)));
		}' unless defined(&__weak_reference);
	    }
	    eval 'sub __warn_references {
	        my($sym,$msg) = @_;
    		eval q( &__asm(\\".stabs \\\\\\"\\" $msg \\"\\\\\\",30,0,0,0\\");  &__asm(\\".stabs \\\\\\"_\\" $sym \\"\\\\\\",1,0,0,0\\"););
	    }' unless defined(&__warn_references);
	} else {
	    eval 'sub __weak_alias {
	        my($alias,$sym) = @_;
    		eval q( &___weak_alias( &_ $alias, &_ $sym));
	    }' unless defined(&__weak_alias);
	    eval 'sub ___weak_alias {
	        my($alias,$sym) = @_;
    		eval q( &__asm(\\".weak alias\\\\nalias = sym\\"););
	    }' unless defined(&___weak_alias);
	    eval 'sub __weak_extern {
	        my($sym) = @_;
    		eval q( &___weak_extern( &_ $sym));
	    }' unless defined(&__weak_extern);
	    eval 'sub ___weak_extern {
	        my($sym) = @_;
    		eval q( &__asm(\\".weak sym\\"););
	    }' unless defined(&___weak_extern);
	    if( &__GNUC_PREREQ__(4, 0)) {
		eval 'sub __weak_reference {
		    my($sym) = @_;
    		    eval q( &__attribute__(( &__weakref__)));
		}' unless defined(&__weak_reference);
	    } else {
		eval 'sub ___weak_reference {
		    my($sym) = @_;
    		    eval q(;  &__asm(\\".weak sym\\"););
		}' unless defined(&___weak_reference);
		eval 'sub __weak_reference {
		    my($sym) = @_;
    		    eval q( &___weak_reference( &_ $sym));
		}' unless defined(&__weak_reference);
	    }
	    eval 'sub __warn_references {
	        my($sym,$msg) = @_;
    		eval q( &__asm(\\".stabs msg,30,0,0,0\\");  &__asm(\\".stabs \\\\\\"_/**/sym\\\\\\",1,0,0,0\\"););
	    }' unless defined(&__warn_references);
	}
    } else {
	eval 'sub __warn_references {
	    my($sym,$msg) = @_;
    	    eval q();
	}' unless defined(&__warn_references);
    }
    if(defined(&__sh__) ) {
	undef(&__indr_reference) if defined(&__indr_reference);
	undef(&__warn_references) if defined(&__warn_references);
	eval 'sub __warn_references {
	    my($sym,$msg) = @_;
    	    eval q();
	}' unless defined(&__warn_references);
    }
    eval 'sub __IDSTRING {
        my($_n,$_s) = @_;
	    eval q( &__asm(\\".data ; .asciz \\\\\\"\\" $_s \\"\\\\\\" ; .text\\"));
    }' unless defined(&__IDSTRING);
    undef(&__KERNEL_RCSID) if defined(&__KERNEL_RCSID);
    eval 'sub __RCSID {
        my($_s) = @_;
	    eval q( &__IDSTRING( &rcsid,$_s));
    }' unless defined(&__RCSID);
    eval 'sub __SCCSID {
        my($_s) = @_;
	    eval q();
    }' unless defined(&__SCCSID);
    eval 'sub __SCCSID2 {
        my($_s) = @_;
	    eval q();
    }' unless defined(&__SCCSID2);
    if(0) {
	eval 'sub __COPYRIGHT {
	    my($_s) = @_;
    	    eval q( &__IDSTRING( &copyright,$_s));
	}' unless defined(&__COPYRIGHT);
    } else {
	eval 'sub __COPYRIGHT {
	    my($_s) = @_;
    	    eval q( &static  &const \'char\'  $copyright[]  &__attribute__(( &__unused__)) = $_s);
	}' unless defined(&__COPYRIGHT);
    }
    if(defined(&USE_KERNEL_RCSIDS) || !defined(&_KERNEL)) {
	eval 'sub __KERNEL_RCSID {
	    my($_n,$_s) = @_;
    	    eval q( &__IDSTRING( &__CONCAT( &rcsid,$_n),$_s));
	}' unless defined(&__KERNEL_RCSID);
    } else {
	eval 'sub __KERNEL_RCSID {
	    my($_n,$_s) = @_;
    	    eval q();
	}' unless defined(&__KERNEL_RCSID);
    }
    eval 'sub __KERNEL_SCCSID {
        my($_n,$_s) = @_;
	    eval q();
    }' unless defined(&__KERNEL_SCCSID);
    eval 'sub __KERNEL_COPYRIGHT {
        my($_n, $_s) = @_;
	    eval q( &__IDSTRING( &__CONCAT( &copyright,$_n),$_s));
    }' unless defined(&__KERNEL_COPYRIGHT);
    unless(defined(&__lint__)) {
	eval 'sub __link_set_make_entry {
	    my($set, $sym, $type) = @_;
    	    eval q( &static  &void  &const *  &const  &__link_set_$set &_sym_$sym  &__used = $sym;  &__asm(\\".stabs \\\\\\"___link_set_\\" $set \\"\\\\\\", \\" $type \\", 0, 0, _\\" $sym));
	}' unless defined(&__link_set_make_entry);
    } else {
	eval 'sub __link_set_make_entry {
	    my($set, $sym, $type) = @_;
    	    eval q( &extern  &void  &const *  &const  &__link_set_$set &_sym_$sym);
	}' unless defined(&__link_set_make_entry);
    }
    eval 'sub __link_set_add_text {
        my($set, $sym) = @_;
	    eval q( &__link_set_make_entry($set, $sym, 23));
    }' unless defined(&__link_set_add_text);
    eval 'sub __link_set_add_rodata {
        my($set, $sym) = @_;
	    eval q( &__link_set_make_entry($set, $sym, 23));
    }' unless defined(&__link_set_add_rodata);
    eval 'sub __link_set_add_data {
        my($set, $sym) = @_;
	    eval q( &__link_set_make_entry($set, $sym, 25));
    }' unless defined(&__link_set_add_data);
    eval 'sub __link_set_add_bss {
        my($set, $sym) = @_;
	    eval q( &__link_set_make_entry($set, $sym, 27));
    }' unless defined(&__link_set_add_bss);
    eval 'sub __link_set_decl {
        my($set, $ptype) = @_;
	    eval q( &extern \'struct struct\' { \'int\'  &__ls_length; $ptype * $__ls_items[1]; }  &__link_set_$set);
    }' unless defined(&__link_set_decl);
    eval 'sub __link_set_start {
        my($set) = @_;
	    eval q((( &__link_set_$set). $__ls_items[0]));
    }' unless defined(&__link_set_start);
    eval 'sub __link_set_end {
        my($set) = @_;
	    eval q((( &__link_set_$set). $__ls_items[( &__link_set_$set). &__ls_length]));
    }' unless defined(&__link_set_end);
    eval 'sub __link_set_count {
        my($set) = @_;
	    eval q((( &__link_set_$set). &__ls_length));
    }' unless defined(&__link_set_count);
}
1;
