require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_MSDOSFS_FAT_H_)) {
    eval 'sub _MSDOSFS_FAT_H_ () {1;}' unless defined(&_MSDOSFS_FAT_H_);
    eval 'sub MSDOSFSROOT () {0;}' unless defined(&MSDOSFSROOT);
    eval 'sub CLUST_FREE () {0;}' unless defined(&CLUST_FREE);
    eval 'sub MSDOSFSFREE () { &CLUST_FREE;}' unless defined(&MSDOSFSFREE);
    eval 'sub CLUST_FIRST () {2;}' unless defined(&CLUST_FIRST);
    eval 'sub CLUST_RSRVD () {0xfffffff6;}' unless defined(&CLUST_RSRVD);
    eval 'sub CLUST_BAD () {0xfffffff7;}' unless defined(&CLUST_BAD);
    eval 'sub CLUST_EOFS () {0xfffffff8;}' unless defined(&CLUST_EOFS);
    eval 'sub CLUST_EOFE () {0xffffffff;}' unless defined(&CLUST_EOFE);
    eval 'sub CLUST_END () { &CLUST_EOFE;}' unless defined(&CLUST_END);
    eval 'sub FAT12_MASK () {0xfff;}' unless defined(&FAT12_MASK);
    eval 'sub FAT16_MASK () {0xffff;}' unless defined(&FAT16_MASK);
    eval 'sub FAT32_MASK () {0xfffffff;}' unless defined(&FAT32_MASK);
    eval 'sub FAT12 {
        my($pmp) = @_;
	    eval q(( ($pmp->{pm_fatmask}) ==  &FAT12_MASK));
    }' unless defined(&FAT12);
    eval 'sub FAT16 {
        my($pmp) = @_;
	    eval q(( ($pmp->{pm_fatmask}) ==  &FAT16_MASK));
    }' unless defined(&FAT16);
    eval 'sub FAT32 {
        my($pmp) = @_;
	    eval q(( ($pmp->{pm_fatmask}) ==  &FAT32_MASK));
    }' unless defined(&FAT32);
    eval 'sub MSDOSFSEOF {
        my($cn, $fatmask) = @_;
	    eval q(((($cn) &  &CLUST_EOFS) == ( &CLUST_EOFS & ($fatmask))));
    }' unless defined(&MSDOSFSEOF);
    if(defined(&_KERNEL) || defined(&MAKEFS)) {
	eval 'sub FAT_GET () {0x1;}' unless defined(&FAT_GET);
	eval 'sub FAT_SET () {0x2;}' unless defined(&FAT_SET);
	eval 'sub FAT_GET_AND_SET () {( &FAT_GET |  &FAT_SET);}' unless defined(&FAT_GET_AND_SET);
	eval 'sub DE_CLEAR () {1;}' unless defined(&DE_CLEAR);
    }
}
1;
