require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_ARM_DISKLABEL_H_)) {
    eval 'sub _ARM_DISKLABEL_H_ () {1;}' unless defined(&_ARM_DISKLABEL_H_);
    unless(defined(&LABELUSESMBR)) {
	eval 'sub LABELUSESMBR () {1;}' unless defined(&LABELUSESMBR);
    }
    eval 'sub LABELSECTOR () {1;}' unless defined(&LABELSECTOR);
    eval 'sub LABELOFFSET () {0;}' unless defined(&LABELOFFSET);
    eval 'sub MAXPARTITIONS () {16;}' unless defined(&MAXPARTITIONS);
    eval 'sub OLDMAXPARTITIONS () {8;}' unless defined(&OLDMAXPARTITIONS);
    unless(defined(&RAW_PART)) {
	eval 'sub RAW_PART () {2;}' unless defined(&RAW_PART);
    }
    if(defined(&__HAVE_OLD_DISKLABEL)) {
	eval 'sub __ARM_MAXDISKS () {((1<< 20) /  &MAXPARTITIONS);}' unless defined(&__ARM_MAXDISKS);
	eval 'sub DISKUNIT {
	    my($dev) = @_;
    	    eval q((( &minor($dev) /  &OLDMAXPARTITIONS) %  &__ARM_MAXDISKS));
	}' unless defined(&DISKUNIT);
	eval 'sub DISKPART {
	    my($dev) = @_;
    	    eval q((( &minor($dev) %  &OLDMAXPARTITIONS) + (( &minor($dev) / ( &__ARM_MAXDISKS *  &OLDMAXPARTITIONS)) *  &OLDMAXPARTITIONS)));
	}' unless defined(&DISKPART);
	eval 'sub DISKMINOR {
	    my($unit, $part) = @_;
    	    eval q(((($unit) *  &OLDMAXPARTITIONS) + (($part) %  &OLDMAXPARTITIONS) + (($part) /  &OLDMAXPARTITIONS) * ( &__ARM_MAXDISKS *  &OLDMAXPARTITIONS)));
	}' unless defined(&DISKMINOR);
    }
    if((defined(&HAVE_NBTOOL_CONFIG_H) ? &HAVE_NBTOOL_CONFIG_H : undef)) {
	require 'nbinclude/sys/dkbad.ph';
	require 'nbinclude/sys/disklabel_acorn.ph';
	require 'nbinclude/sys/bootblock.ph';
    } else {
	require 'sys/dkbad.ph';
	require 'sys/disklabel_acorn.ph';
	require 'sys/bootblock.ph';
    }
    eval 'sub __HAVE_DISKLABEL_DKBAD () {1;}' unless defined(&__HAVE_DISKLABEL_DKBAD);
    if(defined(&_KERNEL)) {
    }
}
1;
