require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_SYS_UN_H_)) {
    eval 'sub _SYS_UN_H_ () {1;}' unless defined(&_SYS_UN_H_);
    require 'sys/ansi.ph';
    require 'sys/featuretest.ph';
    require 'sys/types.ph';
    unless(defined(&sa_family_t)) {
	eval 'sub sa_family_t () { &__sa_family_t;}' unless defined(&sa_family_t);
    }
    if(defined(&_NETBSD_SOURCE)) {
	eval 'sub SOL_LOCAL () {0;}' unless defined(&SOL_LOCAL);
	eval 'sub LOCAL_OCREDS () {0x1;}' unless defined(&LOCAL_OCREDS);
	eval 'sub LOCAL_CONNWAIT () {0x2;}' unless defined(&LOCAL_CONNWAIT);
	eval 'sub LOCAL_PEEREID () {0x3;}' unless defined(&LOCAL_PEEREID);
	eval 'sub LOCAL_CREDS () {0x4;}' unless defined(&LOCAL_CREDS);
    }
    if(defined(&_KERNEL)) {
    } else {
	if(defined(&_NETBSD_SOURCE)) {
	    eval 'sub SUN_LEN {
	        my($su) = @_;
    		eval q(($sizeof{($su)} - $sizeof{($su)-> &sun_path} +  &strlen(($su)-> &sun_path)));
	    }' unless defined(&SUN_LEN);
	}
    }
}
1;
