require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&lib_pcap_compiler_tests_h)) {
    eval 'sub lib_pcap_compiler_tests_h () {1;}' unless defined(&lib_pcap_compiler_tests_h);
    unless(defined(&__has_attribute)) {
	eval 'sub __has_attribute {
	    my($x) = @_;
    	    eval q(0);
	}' unless defined(&__has_attribute);
    }
    if(! defined(&__GNUC__)) {
	eval 'sub PCAP_IS_AT_LEAST_GNUC_VERSION {
	    my($major, $minor) = @_;
    	    eval q(0);
	}' unless defined(&PCAP_IS_AT_LEAST_GNUC_VERSION);
    } else {
	eval 'sub PCAP_IS_AT_LEAST_GNUC_VERSION {
	    my($major, $minor) = @_;
    	    eval q(( &__GNUC__ > ($major) || ( &__GNUC__ == ($major)  &&  &__GNUC_MINOR__ >= ($minor))));
	}' unless defined(&PCAP_IS_AT_LEAST_GNUC_VERSION);
    }
    if(!defined(&__clang__)) {
	eval 'sub PCAP_IS_AT_LEAST_CLANG_VERSION {
	    my($major, $minor) = @_;
    	    eval q(0);
	}' unless defined(&PCAP_IS_AT_LEAST_CLANG_VERSION);
    } else {
	eval 'sub PCAP_IS_AT_LEAST_CLANG_VERSION {
	    my($major, $minor) = @_;
    	    eval q(( &__clang_major__ > ($major) || ( &__clang_major__ == ($major)  &&  &__clang_minor__ >= ($minor))));
	}' unless defined(&PCAP_IS_AT_LEAST_CLANG_VERSION);
    }
    if(! defined(&__SUNPRO_C)) {
	eval 'sub PCAP_IS_AT_LEAST_SUNC_VERSION {
	    my($major,$minor) = @_;
    	    eval q(0);
	}' unless defined(&PCAP_IS_AT_LEAST_SUNC_VERSION);
    } else {
	eval 'sub PCAP_SUNPRO_VERSION_TO_BCD {
	    my($major, $minor) = @_;
    	    eval q(((($minor) >= 10) ? ((($major) << 12) | ((($minor)/10) << 8) | ((($minor)%10) << 4)) : ((($major) << 8) | (($minor) << 4))));
	}' unless defined(&PCAP_SUNPRO_VERSION_TO_BCD);
	eval 'sub PCAP_IS_AT_LEAST_SUNC_VERSION {
	    my($major,$minor) = @_;
    	    eval q(( &__SUNPRO_C >=  &PCAP_SUNPRO_VERSION_TO_BCD(($major), ($minor))));
	}' unless defined(&PCAP_IS_AT_LEAST_SUNC_VERSION);
    }
    if(! defined(&__xlC__)) {
	eval 'sub PCAP_IS_AT_LEAST_XL_C_VERSION {
	    my($major,$minor) = @_;
    	    eval q(0);
	}' unless defined(&PCAP_IS_AT_LEAST_XL_C_VERSION);
    } else {
	eval 'sub PCAP_IS_AT_LEAST_XL_C_VERSION {
	    my($major, $minor) = @_;
    	    eval q(( &__xlC__ >= ((($major) << 8) | ($minor))));
	}' unless defined(&PCAP_IS_AT_LEAST_XL_C_VERSION);
    }
    if(! defined(&__HP_aCC)) {
	eval 'sub PCAP_IS_AT_LEAST_HP_C_VERSION {
	    my($major,$minor) = @_;
    	    eval q(0);
	}' unless defined(&PCAP_IS_AT_LEAST_HP_C_VERSION);
    } else {
	eval 'sub PCAP_IS_AT_LEAST_HP_C_VERSION {
	    my($major,$minor) = @_;
    	    eval q(( &__HP_aCC >= (($major)*10000+ ($minor)*100)));
	}' unless defined(&PCAP_IS_AT_LEAST_HP_C_VERSION);
    }
}
1;
