require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SGIMIPS_LOADFILE_MACHDEP_H_)) {
    eval 'sub _SGIMIPS_LOADFILE_MACHDEP_H_ () {1;}' unless defined(&_SGIMIPS_LOADFILE_MACHDEP_H_);
    eval 'sub BOOT_AOUT () {1;}' unless defined(&BOOT_AOUT);
    eval 'sub BOOT_ECOFF () {1;}' unless defined(&BOOT_ECOFF);
    eval 'sub BOOT_ELF32 () {1;}' unless defined(&BOOT_ELF32);
    eval 'sub LOAD_KERNEL () {( &LOAD_ALL & ~ &LOAD_TEXTA);}' unless defined(&LOAD_KERNEL);
    eval 'sub COUNT_KERNEL () {( &COUNT_ALL & ~ &COUNT_TEXTA);}' unless defined(&COUNT_KERNEL);
    eval 'sub LOADADDR {
        my($a) = @_;
	    eval q(((($a)) +  &offset));
    }' unless defined(&LOADADDR);
    eval 'sub ALIGNENTRY {
        my($a) = @_;
	    eval q((($a)));
    }' unless defined(&ALIGNENTRY);
    eval 'sub READ {
        my($f, $b, $c) = @_;
	    eval q( &read(($f), ( &void *) &LOADADDR($b), ($c)));
    }' unless defined(&READ);
    eval 'sub BCOPY {
        my($s, $d, $c) = @_;
	    eval q( &memcpy(( &void *) &LOADADDR($d), ( &void *)($s), ($c)));
    }' unless defined(&BCOPY);
    eval 'sub BZERO {
        my($d, $c) = @_;
	    eval q( &memset(( &void *) &LOADADDR($d), 0, ($c)));
    }' unless defined(&BZERO);
    eval 'sub WARN {
        my($a) = @_;
	    eval q(( &void)( &printf $a,  &printf(( &errno ? \\": %s\\\\n\\" : \\"\\\\n\\"),  &strerror( &errno))));
    }' unless defined(&WARN);
    eval 'sub PROGRESS {
        my($a) = @_;
	    eval q(( &void)  &printf $a);
    }' unless defined(&PROGRESS);
    eval 'sub ALLOC {
        my($a) = @_;
	    eval q( &alloc($a));
    }' unless defined(&ALLOC);
    eval 'sub FREE {
        my($a, $b) = @_;
	    eval q( &free($a, $b));
    }' unless defined(&FREE);
    eval 'sub OKMAGIC {
        my($a) = @_;
	    eval q((($a) ==  &OMAGIC));
    }' unless defined(&OKMAGIC);
}
1;
