require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&lib_pcap_funcattrs_h)) {
    eval 'sub lib_pcap_funcattrs_h () {1;}' unless defined(&lib_pcap_funcattrs_h);
    require 'pcap/compiler-tests.ph';
    if(defined(&_WIN32)) {
	if(defined(&pcap_EXPORTS)) {
	    eval 'sub PCAP_API_DEF () { &__declspec( &dllexport);}' unless defined(&PCAP_API_DEF);
	}
 elsif(defined(&PCAP_DLL)) {
	    eval 'sub PCAP_API_DEF () { &__declspec( &dllimport);}' unless defined(&PCAP_API_DEF);
	} else {
	    eval 'sub PCAP_API_DEF () {1;}' unless defined(&PCAP_API_DEF);
	}
    }
 elsif(defined(&MSDOS)) {
	eval 'sub PCAP_API_DEF () {1;}' unless defined(&PCAP_API_DEF);
    } else {
	if(defined(&pcap_EXPORTS)) {
	    if( &PCAP_IS_AT_LEAST_GNUC_VERSION(3,4) ||  &PCAP_IS_AT_LEAST_XL_C_VERSION(12,0)) {
		eval 'sub PCAP_API_DEF () { &__attribute__(( &visibility("default")));}' unless defined(&PCAP_API_DEF);
	    }
 elsif( &PCAP_IS_AT_LEAST_SUNC_VERSION(5,5)) {
		eval 'sub PCAP_API_DEF () { &__global;}' unless defined(&PCAP_API_DEF);
	    } else {
		eval 'sub PCAP_API_DEF () {1;}' unless defined(&PCAP_API_DEF);
	    }
	} else {
	    eval 'sub PCAP_API_DEF () {1;}' unless defined(&PCAP_API_DEF);
	}
    }
    eval 'sub PCAP_API () { &PCAP_API_DEF  &extern;}' unless defined(&PCAP_API);
    if( &__has_attribute((defined(&noreturn) ? &noreturn : undef)) ||  &PCAP_IS_AT_LEAST_GNUC_VERSION(2,5) ||  &PCAP_IS_AT_LEAST_SUNC_VERSION(5,9) ||  &PCAP_IS_AT_LEAST_XL_C_VERSION(10,1) ||  &PCAP_IS_AT_LEAST_HP_C_VERSION(6,10)) {
	eval 'sub PCAP_NORETURN () { &__attribute(( &noreturn));}' unless defined(&PCAP_NORETURN);
	eval 'sub PCAP_NORETURN_DEF () { &__attribute(( &noreturn));}' unless defined(&PCAP_NORETURN_DEF);
    }
 elsif(defined(&_MSC_VER)) {
	eval 'sub PCAP_NORETURN () { &__declspec( &noreturn);}' unless defined(&PCAP_NORETURN);
	eval 'sub PCAP_NORETURN_DEF () {1;}' unless defined(&PCAP_NORETURN_DEF);
    } else {
	eval 'sub PCAP_NORETURN () {1;}' unless defined(&PCAP_NORETURN);
	eval 'sub PCAP_NORETURN_DEF () {1;}' unless defined(&PCAP_NORETURN_DEF);
    }
    if( &__has_attribute((defined(&__format__) ? &__format__ : undef)) ||  &PCAP_IS_AT_LEAST_GNUC_VERSION(2,3) ||  &PCAP_IS_AT_LEAST_XL_C_VERSION(10,1) ||  &PCAP_IS_AT_LEAST_HP_C_VERSION(6,10)) {
	eval 'sub PCAP_PRINTFLIKE {
	    my($x,$y) = @_;
    	    eval q( &__attribute__(( &__format__( &__printf__,$x,$y))));
	}' unless defined(&PCAP_PRINTFLIKE);
    } else {
	eval 'sub PCAP_PRINTFLIKE {
	    my($x,$y) = @_;
    	    eval q();
	}' unless defined(&PCAP_PRINTFLIKE);
    }
    if( &__has_attribute((defined(&deprecated) ? &deprecated : undef)) ||  &PCAP_IS_AT_LEAST_GNUC_VERSION(4,5) ||  &PCAP_IS_AT_LEAST_SUNC_VERSION(5,13)) {
	eval 'sub PCAP_DEPRECATED {
	    my($func, $msg) = @_;
    	    eval q( &__attribute__(( &deprecated($msg))));
	}' unless defined(&PCAP_DEPRECATED);
    }
 elsif( &PCAP_IS_AT_LEAST_GNUC_VERSION(3,1)) {
	eval 'sub PCAP_DEPRECATED {
	    my($func, $msg) = @_;
    	    eval q( &__attribute__(( &deprecated)));
	}' unless defined(&PCAP_DEPRECATED);
    }
 elsif((defined(&_MSC_VER)  && ((defined(&_MSC_VER) ? &_MSC_VER : undef) >= 1500))  && !defined(&BUILDING_PCAP)) {
	eval 'sub PCAP_DEPRECATED {
	    my($func, $msg) = @_;
    	    eval q( &__pragma( &deprecated($func)));
	}' unless defined(&PCAP_DEPRECATED);
    } else {
	eval 'sub PCAP_DEPRECATED {
	    my($func, $msg) = @_;
    	    eval q();
	}' unless defined(&PCAP_DEPRECATED);
    }
    if(defined(&_MSC_VER)) {
	require 'sal.ph';
	if((defined(&_MSC_VER) ? &_MSC_VER : undef) > 1400) {
	    eval 'sub PCAP_FORMAT_STRING {
	        my($p) = @_;
    		eval q( &_Printf_format_string_ $p);
	    }' unless defined(&PCAP_FORMAT_STRING);
	} else {
	    eval 'sub PCAP_FORMAT_STRING {
	        my($p) = @_;
    		eval q( &__format_string $p);
	    }' unless defined(&PCAP_FORMAT_STRING);
	}
    } else {
	eval 'sub PCAP_FORMAT_STRING {
	    my($p) = @_;
    	    eval q($p);
	}' unless defined(&PCAP_FORMAT_STRING);
    }
}
1;
