require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&N_PAGSIZ)) {
    eval 'sub N_PAGSIZ {
        my($ex) = @_;
	    eval q(( &__LDPGSZ));
    }' unless defined(&N_PAGSIZ);
}
unless(defined(&OMAGIC)) {
    sub OMAGIC () {	0407;}
}
unless(defined(&NMAGIC)) {
    sub NMAGIC () {	0410;}
}
unless(defined(&ZMAGIC)) {
    sub ZMAGIC () {	0413;}
}
unless(defined(&QMAGIC)) {
    sub QMAGIC () {	0314;}
}
unless(defined(&MID_ZERO)) {
    sub MID_ZERO () {	0;}
}
unless(defined(&MID_SUN010)) {
    sub MID_SUN010 () {	1;}
}
unless(defined(&MID_SUN020)) {
    sub MID_SUN020 () {	2;}
}
unless(defined(&MID_PC386)) {
    sub MID_PC386 () {	100;}
}
unless(defined(&MID_ROMPAOS)) {
    sub MID_ROMPAOS () {	104;}
}
unless(defined(&MID_I386)) {
    sub MID_I386 () {	134;}
}
unless(defined(&MID_M68K)) {
    sub MID_M68K () {	135;}
}
unless(defined(&MID_M68K4K)) {
    sub MID_M68K4K () {	136;}
}
unless(defined(&MID_NS32532)) {
    sub MID_NS32532 () {	137;}
}
unless(defined(&MID_SPARC)) {
    sub MID_SPARC () {	138;}
}
unless(defined(&MID_PMAX)) {
    sub MID_PMAX () {	139;}
}
unless(defined(&MID_VAX1K)) {
    sub MID_VAX1K () {	140;}
}
unless(defined(&MID_ALPHA)) {
    sub MID_ALPHA () {	141;}
}
unless(defined(&MID_MIPS)) {
    sub MID_MIPS () {	142;}
}
unless(defined(&MID_ARM6)) {
    sub MID_ARM6 () {	143;}
}
unless(defined(&MID_SH3)) {
    sub MID_SH3 () {	145;}
}
unless(defined(&MID_POWERPC)) {
    sub MID_POWERPC () {	149;}
}
unless(defined(&MID_VAX)) {
    sub MID_VAX () {	150;}
}
unless(defined(&MID_SPARC64)) {
    sub MID_SPARC64 () {	151;}
}
unless(defined(&MID_MIPS2)) {
    sub MID_MIPS2 () {	152;}
}
unless(defined(&MID_M88K)) {
    sub MID_M88K () {	153;}
}
unless(defined(&MID_HPPA)) {
    sub MID_HPPA () {	154;}
}
unless(defined(&MID_AMD64)) {
    sub MID_AMD64 () {	157;}
}
unless(defined(&MID_MIPS64)) {
    sub MID_MIPS64 () {	158;}
}
unless(defined(&MID_HP200)) {
    sub MID_HP200 () {	200;}
}
unless(defined(&MID_HP300)) {
    sub MID_HP300 () {	300;}
}
unless(defined(&MID_HPUX)) {
    sub MID_HPUX () {	0x20c;}
}
unless(defined(&MID_HPUX800)) {
    sub MID_HPUX800 () {	0x20b;}
}
unless(defined(&MID_HPPA11)) {
    sub MID_HPPA11 () {	0x210;}
}
unless(defined(&MID_HPPA20)) {
    sub MID_HPPA20 () {	0x214;}
}
unless(defined(&EX_DYNAMIC)) {
    sub EX_DYNAMIC () {	0x20;}
}
unless(defined(&EX_PIC)) {
    sub EX_PIC () {	0x10;}
}
unless(defined(&EX_DPMASK)) {
    sub EX_DPMASK () {	0x30;}
}
unless(defined(&N_GETMAGIC)) {
    sub N_GETMAGIC {
	my($ex) = @_;
	eval q(( ((($ex). &a_midmag)&0xffff0000) ? ( &ntohl((($ex). &a_midmag))&0xffff) : (($ex). &a_midmag)));
    }
}
unless(defined(&N_GETMAGIC2)) {
    sub N_GETMAGIC2 {
	my($ex) = @_;
	eval q(( ((($ex). &a_midmag)&0xffff0000) ? ( &ntohl((($ex). &a_midmag))&0xffff) : ((($ex). &a_midmag) | 0x10000) ));
    }
}
unless(defined(&N_GETMID)) {
    sub N_GETMID {
	my($ex) = @_;
	eval q(( ((($ex). &a_midmag)&0xffff0000) ? (( &ntohl((($ex). &a_midmag))>>16)&0x3ff) :  &MID_ZERO ));
    }
}
unless(defined(&N_GETFLAG)) {
    sub N_GETFLAG {
	my($ex) = @_;
	eval q(( ((($ex). &a_midmag)&0xffff0000) ? (( &ntohl((($ex). &a_midmag))>>26)&0x3f) : 0));
    }
}
unless(defined(&N_SETMAGIC)) {
    sub N_SETMAGIC {
	my($ex,$mag,$mid,$flag) = @_;
	eval q(( ($ex). &a_midmag =  &htonl( ((($flag)&0x3f)<<26) | ((($mid)&0x3ff)<<16) | ((($mag)&0xffff)) ) ));
    }
}
unless(defined(&N_ALIGN)) {
    sub N_ALIGN {
	my($ex,$x) = @_;
	eval q(( &N_GETMAGIC($ex) ==  &ZMAGIC ||  &N_GETMAGIC($ex) ==  &QMAGIC ? (($x) +  &__LDPGSZ - 1) & ~( &__LDPGSZ - 1) : ($x)));
    }
}
unless(defined(&N_BADMAG)) {
    sub N_BADMAG {
	my($ex) = @_;
	eval q(( &N_GETMAGIC($ex) !=  &NMAGIC  &&  &N_GETMAGIC($ex) !=  &OMAGIC  &&  &N_GETMAGIC($ex) !=  &ZMAGIC  &&  &N_GETMAGIC($ex) !=  &QMAGIC));
    }
}
unless(defined(&N_TXTADDR)) {
    sub N_TXTADDR {
	my($ex) = @_;
	eval q(( &N_GETMAGIC2($ex) == ( &ZMAGIC|0x10000) ? 0:  &__LDPGSZ));
    }
}
unless(defined(&N_DATADDR)) {
    sub N_DATADDR {
	my($ex) = @_;
	eval q(( &N_GETMAGIC($ex) ==  &OMAGIC ?  &N_TXTADDR($ex) + ($ex). &a_text : ( &N_TXTADDR($ex) + ($ex). &a_text +  &__LDPGSZ - 1) & ~( &__LDPGSZ - 1)));
    }
}
unless(defined(&N_BSSADDR)) {
    sub N_BSSADDR {
	my($ex) = @_;
	eval q(( &N_DATADDR($ex) + ($ex). &a_data));
    }
}
unless(defined(&N_TXTOFF)) {
    sub N_TXTOFF {
	my($ex) = @_;
	eval q((  &N_GETMAGIC2($ex)== &ZMAGIC ||  &N_GETMAGIC2($ex)==( &QMAGIC|0x10000) ? 0: ( &N_GETMAGIC2($ex)==( &ZMAGIC|0x10000) ?  &__LDPGSZ : $sizeof{'struct exec'}) ));
    }
}
unless(defined(&N_DATOFF)) {
    sub N_DATOFF {
	my($ex) = @_;
	eval q( &N_ALIGN($ex,  &N_TXTOFF($ex) + ($ex). &a_text));
    }
}
unless(defined(&N_TRELOFF)) {
    sub N_TRELOFF {
	my($ex) = @_;
	eval q(( &N_DATOFF($ex) + ($ex). &a_data));
    }
}
unless(defined(&N_DRELOFF)) {
    sub N_DRELOFF {
	my($ex) = @_;
	eval q(( &N_TRELOFF($ex) + ($ex). &a_trsize));
    }
}
unless(defined(&N_SYMOFF)) {
    sub N_SYMOFF {
	my($ex) = @_;
	eval q(( &N_DRELOFF($ex) + ($ex). &a_drsize));
    }
}
unless(defined(&N_STROFF)) {
    sub N_STROFF {
	my($ex) = @_;
	eval q(( &N_SYMOFF($ex) + ($ex). &a_syms));
    }
}
if(defined(&_KERNEL)) {
    if(!defined( &cpu_exec_aout_makecmds)) {
    }
}
1;
