require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&lib_pcap_socket_h)) {
    eval 'sub lib_pcap_socket_h () {1;}' unless defined(&lib_pcap_socket_h);
    if(defined(&_WIN32)) {
	if(defined(&__MINGW32__)) {
	    require 'windef.ph';
	}
	require 'winsock2.ph';
	require 'ws2tcpip.ph';
    } else {
	require 'sys/types.ph';
	require 'sys/socket.ph';
	require 'netdb.ph';
	require 'netinet/in.ph';
	require 'arpa/inet.ph';
	unless(defined(&SOCKET)) {
	    eval 'sub SOCKET () {\'int\';}' unless defined(&SOCKET);
	}
	unless(defined(&INVALID_SOCKET)) {
	    eval 'sub INVALID_SOCKET () {-1;}' unless defined(&INVALID_SOCKET);
	}
    }
}
1;
