require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_NETDB_H_)) {
    eval 'sub _NETDB_H_ () {1;}' unless defined(&_NETDB_H_);
    require 'sys/cdefs.ph';
    require 'machine/endian_machdep.ph';
    require 'sys/ansi.ph';
    require 'sys/featuretest.ph';
    require 'inttypes.ph';
    unless(defined(&socklen_t)) {
	eval 'sub socklen_t () { &__socklen_t;}' unless defined(&socklen_t);
    }
    if(defined(&_BSD_SIZE_T_)) {
	undef(&_BSD_SIZE_T_) if defined(&_BSD_SIZE_T_);
    }
    if(defined(&_NETBSD_SOURCE)) {
	unless(defined(&_PATH_HEQUIV)) {
	    eval 'sub _PATH_HEQUIV () {"/etc/hosts.equiv";}' unless defined(&_PATH_HEQUIV);
	}
	unless(defined(&_PATH_HOSTS)) {
	    eval 'sub _PATH_HOSTS () {"/etc/hosts";}' unless defined(&_PATH_HOSTS);
	}
	unless(defined(&_PATH_NETWORKS)) {
	    eval 'sub _PATH_NETWORKS () {"/etc/networks";}' unless defined(&_PATH_NETWORKS);
	}
	unless(defined(&_PATH_PROTOCOLS)) {
	    eval 'sub _PATH_PROTOCOLS () {"/etc/protocols";}' unless defined(&_PATH_PROTOCOLS);
	}
	unless(defined(&_PATH_SERVICES)) {
	    eval 'sub _PATH_SERVICES () {"/etc/services";}' unless defined(&_PATH_SERVICES);
	}
	unless(defined(&_PATH_SERVICES_CDB)) {
	    eval 'sub _PATH_SERVICES_CDB () {"/var/db/services.cdb";}' unless defined(&_PATH_SERVICES_CDB);
	}
	unless(defined(&_PATH_SERVICES_DB)) {
	    eval 'sub _PATH_SERVICES_DB () {"/var/db/services.db";}' unless defined(&_PATH_SERVICES_DB);
	}
    }
    if(defined(&_REENTRANT)) {
	eval 'sub h_errno () {(* &__h_errno());}' unless defined(&h_errno);
    }
    eval 'sub h_addr () { $h_addr_list[0];}' unless defined(&h_addr);
    if(defined(&__sparc__)  && defined(&_LP64)) {
    }
    if(defined(&__alpha__)) {
    }
    if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200112 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 520|| defined(&_NETBSD_SOURCE)) {
	if(defined(&__sparc__)  && defined(&_LP64)) {
	}
	if(defined(&__alpha__)) {
	}
    }
    if(defined(&_NETBSD_SOURCE)) {
	eval 'sub NETDB_INTERNAL () {-1;}' unless defined(&NETDB_INTERNAL);
	eval 'sub NETDB_SUCCESS () {0;}' unless defined(&NETDB_SUCCESS);
    }
    eval 'sub NO_ADDRESS () { &NO_DATA;}' unless defined(&NO_ADDRESS);
    eval 'sub HOST_NOT_FOUND () {1;}' unless defined(&HOST_NOT_FOUND);
    eval 'sub TRY_AGAIN () {2;}' unless defined(&TRY_AGAIN);
    eval 'sub NO_RECOVERY () {3;}' unless defined(&NO_RECOVERY);
    eval 'sub NO_DATA () {4;}' unless defined(&NO_DATA);
    if(defined(&_NETBSD_SOURCE)) {
	eval 'sub NO_ADDRESS () { &NO_DATA;}' unless defined(&NO_ADDRESS);
    }
    if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200112 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 520|| defined(&_NETBSD_SOURCE)) {
	eval 'sub EAI_ADDRFAMILY () {1;}' unless defined(&EAI_ADDRFAMILY);
	eval 'sub EAI_AGAIN () {2;}' unless defined(&EAI_AGAIN);
	eval 'sub EAI_BADFLAGS () {3;}' unless defined(&EAI_BADFLAGS);
	eval 'sub EAI_FAIL () {4;}' unless defined(&EAI_FAIL);
	eval 'sub EAI_FAMILY () {5;}' unless defined(&EAI_FAMILY);
	eval 'sub EAI_MEMORY () {6;}' unless defined(&EAI_MEMORY);
	eval 'sub EAI_NODATA () {7;}' unless defined(&EAI_NODATA);
	eval 'sub EAI_NONAME () {8;}' unless defined(&EAI_NONAME);
	eval 'sub EAI_SERVICE () {9;}' unless defined(&EAI_SERVICE);
	eval 'sub EAI_SOCKTYPE () {10;}' unless defined(&EAI_SOCKTYPE);
	eval 'sub EAI_SYSTEM () {11;}' unless defined(&EAI_SYSTEM);
	eval 'sub EAI_BADHINTS () {12;}' unless defined(&EAI_BADHINTS);
	eval 'sub EAI_PROTOCOL () {13;}' unless defined(&EAI_PROTOCOL);
	eval 'sub EAI_OVERFLOW () {14;}' unless defined(&EAI_OVERFLOW);
	eval 'sub EAI_MAX () {15;}' unless defined(&EAI_MAX);
    }
    if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200112 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 520|| defined(&_NETBSD_SOURCE)) {
	eval 'sub AI_PASSIVE () {0x1;}' unless defined(&AI_PASSIVE);
	eval 'sub AI_CANONNAME () {0x2;}' unless defined(&AI_CANONNAME);
	eval 'sub AI_NUMERICHOST () {0x4;}' unless defined(&AI_NUMERICHOST);
	eval 'sub AI_NUMERICSERV () {0x8;}' unless defined(&AI_NUMERICSERV);
	eval 'sub AI_ADDRCONFIG () {0x400;}' unless defined(&AI_ADDRCONFIG);
	if(defined(&_NETBSD_SOURCE)) {
	    eval 'sub AI_SRV () {0x800;}' unless defined(&AI_SRV);
	    eval 'sub AI_MASK () {( &AI_PASSIVE |  &AI_CANONNAME |  &AI_NUMERICHOST |  &AI_NUMERICSERV |  &AI_ADDRCONFIG |  &AI_SRV);}' unless defined(&AI_MASK);
	} else {
	    eval 'sub AI_MASK () {( &AI_PASSIVE |  &AI_CANONNAME |  &AI_NUMERICHOST |  &AI_NUMERICSERV |  &AI_ADDRCONFIG);}' unless defined(&AI_MASK);
	}
    }
    if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200112 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 520|| defined(&_NETBSD_SOURCE)) {
	if(defined(&_NETBSD_SOURCE)) {
	    eval 'sub NI_MAXHOST () {1025;}' unless defined(&NI_MAXHOST);
	    eval 'sub NI_MAXSERV () {32;}' unless defined(&NI_MAXSERV);
	}
	eval 'sub NI_NOFQDN () {0x1;}' unless defined(&NI_NOFQDN);
	eval 'sub NI_NUMERICHOST () {0x2;}' unless defined(&NI_NUMERICHOST);
	eval 'sub NI_NAMEREQD () {0x4;}' unless defined(&NI_NAMEREQD);
	eval 'sub NI_NUMERICSERV () {0x8;}' unless defined(&NI_NUMERICSERV);
	eval 'sub NI_DGRAM () {0x10;}' unless defined(&NI_DGRAM);
	eval 'sub NI_WITHSCOPEID () {0x20;}' unless defined(&NI_WITHSCOPEID);
	eval 'sub NI_NUMERICSCOPE () {0x40;}' unless defined(&NI_NUMERICSCOPE);
	if(defined(&_NETBSD_SOURCE)) {
	    eval 'sub SCOPE_DELIMITER () {ord(\'%\');}' unless defined(&SCOPE_DELIMITER);
	}
    }
    if(((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 520 && ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) < 600|| defined(&_NETBSD_SOURCE)) {
	if(0) {
	}
    }
    if(defined(&_NETBSD_SOURCE)) {
    }
    if(defined(&_NETBSD_SOURCE)) {
    }
    if(defined(&_NETBSD_SOURCE)) {
    }
    if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200112 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 520|| defined(&_NETBSD_SOURCE)) {
    }
}
1;
