require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_DIRENT_H_)) {
    eval 'sub _DIRENT_H_ () {1;}' unless defined(&_DIRENT_H_);
    require 'sys/featuretest.ph';
    require 'sys/types.ph';
    require 'sys/dirent.ph';
    if(defined(&_XOPEN_SOURCE) || defined(&_NETBSD_SOURCE)) {
	eval 'sub d_ino () { &d_fileno;}' unless defined(&d_ino);
    }
    if(defined(&_NETBSD_SOURCE)) {
	eval 'sub DIRBLKSIZ () {1024;}' unless defined(&DIRBLKSIZ);
	eval 'sub dirfd {
	    my($dirp) = @_;
    	    eval q((($dirp)-> &dd_fd));
	}' unless defined(&dirfd);
	eval 'sub DTF_HIDEW () {0x1;}' unless defined(&DTF_HIDEW);
	eval 'sub DTF_NODUP () {0x2;}' unless defined(&DTF_NODUP);
	eval 'sub DTF_REWIND () {0x4;}' unless defined(&DTF_REWIND);
	eval 'sub __DTF_READALL () {0x8;}' unless defined(&__DTF_READALL);
	eval 'sub __DTF_RETRY_ON_BADCOOKIE () {0x1;}' unless defined(&__DTF_RETRY_ON_BADCOOKIE);
	require 'sys/null.ph';
    }
    unless(defined(&_KERNEL)) {
	require 'sys/cdefs.ph';
	unless(defined(&__LIBC12_SOURCE__)) {
	}
	if(defined(&_XOPEN_SOURCE) || defined(&_NETBSD_SOURCE)) {
	}
	if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200809 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 700|| defined(&_NETBSD_SOURCE)) {
	    unless(defined(&__LIBC12_SOURCE__)) {
	    }
	}
	if(defined(&_NETBSD_SOURCE)) {
	    unless(defined(&__LIBC12_SOURCE__)) {
	    }
	}
    }
}
1;
