This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Socket to CPAN version 2.010
authorAristotle Pagaltzis <pagaltzis@gmx.de>
Sun, 21 Jul 2013 04:43:47 +0000 (06:43 +0200)
committerAristotle Pagaltzis <pagaltzis@gmx.de>
Sun, 21 Jul 2013 04:43:47 +0000 (06:43 +0200)
[DELTA]

2013/06/24
2.010   CHANGES:
         * Wrap some IPTOS_* constants, which may come from <netinet/ip.h>
         * Probe for and optionally include <netinet/ip.h>
         * Defeat C compilers' attempts to optimise away configure-time probes
           for functions that are never called

Porting/Maintainers.pl
cpan/Socket/Makefile.PL
cpan/Socket/Socket.pm
cpan/Socket/Socket.xs

index c852804..20046f7 100755 (executable)
@@ -1574,7 +1574,7 @@ use File::Glob qw(:case);
 
     'Socket' => {
         'MAINTAINER'   => 'pevans',
-        'DISTRIBUTION' => 'PEVANS/Socket-2.009.tar.gz',
+        'DISTRIBUTION' => 'PEVANS/Socket-2.010.tar.gz',
         'FILES'        => q[cpan/Socket],
         'UPSTREAM'     => 'cpan',
     },
index 117d778..0eadd3f 100644 (file)
@@ -19,7 +19,8 @@ sub check_for
     require ExtUtils::CBuilder;
     $cb ||= ExtUtils::CBuilder->new( quiet => 1 );
 
-    my $main = $args{main};
+    my $main   = $args{main}   || "";
+    my $header = $args{header} || "";
 
     print "Checking $args{define}...\n";
 
@@ -40,6 +41,7 @@ sub check_for
 # include <netinet/in.h>
 # include <arpa/inet.h>
 #endif
+$header
 int main(int argc, char *argv[])
   {
     (void)argc;
@@ -70,7 +72,7 @@ sub check_for_func
 {
     my %args = @_;
     my $func = delete $args{func};
-    check_for( %args, main => "void *p = &$func; (void)p;" );
+    check_for( %args, main => "void *p = &$func; if(p == NULL) return 1;" );
 }
 
 my %defines = (
@@ -115,7 +117,6 @@ check_for(
     main    => "struct ip_mreq mreq; mreq.imr_multiaddr.s_addr = INADDR_ANY;"
 );
 
-# TODO: Needs adding to perl5 core before importing dual-life again
 check_for(
     confkey => "d_ip_mreq_source",
     define  => "HAS_IP_MREQ_SOURCE",
@@ -128,6 +129,13 @@ check_for(
     main    => "struct ipv6_mreq mreq; mreq.ipv6mr_interface = 0;"
 );
 
+# TODO: Needs adding to perl5 core before importing dual-life again
+check_for(
+    confkey => "i_netinet_ip",
+    define  => "I_NETINET_IP",
+    header  => "#include <netinet/ip.h>",
+);
+
 my %makefile_args;
 
 # Since we're providing a later version of a core module, before 5.12 the
@@ -170,8 +178,10 @@ my @names = (
 
        IP_ADD_MEMBERSHIP IP_ADD_SOURCE_MEMBERSHIP IP_DROP_MEMBERSHIP
        IP_DROP_SOURCE_MEMBERSHIP IP_HDRINCL IP_MULTICAST_IF IP_MULTICAST_LOOP
-       IP_MULTICAST_TTL IP_OPTIONS IP_RECVOPTS IP_RECVRETOPTS IP_RETOPTS IP_TOS
-       IP_TTL 
+       IP_MULTICAST_TTL IP_OPTIONS IP_RECVOPTS IP_RECVRETOPTS IP_RETOPTS IP_TOS
+       IP_TTL
+
+       IPTOS_LOWDELAY IPTOS_THROUGHPUT IPTOS_RELIABILITY IPTOS_MINCOST
 
        IPV6_ADD_MEMBERSHIP IPV6_DROP_MEMBERSHIP IPV6_JOIN_GROUP
        IPV6_LEAVE_GROUP IPV6_MTU IPV6_MTU_DISCOVER IPV6_MULTICAST_HOPS
index 270e4ed..0556ae0 100644 (file)
@@ -3,7 +3,7 @@ package Socket;
 use strict;
 { use 5.006001; }
 
-our $VERSION = '2.009';
+our $VERSION = '2.010';
 
 =head1 NAME
 
@@ -108,6 +108,10 @@ C<SOL_SOCKET> level.
 Socket option name constants for IPv4 socket options at the C<IPPROTO_IP>
 level.
 
+=head2 IPTOS_LOWDELAY, IPTOS_THROUGHPUT, IPTOS_RELIABILITY, ...
+
+Socket option value constants for C<IP_TOS> socket option.
+
 =head2 MSG_BCAST, MSG_OOB, MSG_TRUNC, ...
 
 Message flag constants for send() and recv().
@@ -578,8 +582,8 @@ service on the named host.
  print <$sock>;
 
 Because a list of potential candidates is returned, the C<while> loop tries
-each in turn until it it finds one that succeeds both the socket() and
-connect() calls.
+each in turn until it finds one that succeeds both the socket() and connect()
+calls.
 
 This function performs the work of the legacy functions gethostbyname(),
 getservbyname(), inet_aton() and pack_sockaddr_in().
@@ -759,6 +763,8 @@ our @EXPORT_OK = qw(
        IPPROTO_IP IPPROTO_IPV6 IPPROTO_RAW IPPROTO_ICMP IPPROTO_TCP
        IPPROTO_UDP
 
+       IPTOS_LOWDELAY IPTOS_THROUGHPUT IPTOS_RELIABILITY IPTOS_MINCOST
+
        TCP_CONGESTION TCP_CONNECTIONTIMEOUT TCP_CORK TCP_DEFER_ACCEPT TCP_INFO
        TCP_INIT_CWND TCP_KEEPALIVE TCP_KEEPCNT TCP_KEEPIDLE TCP_KEEPINTVL
        TCP_LINGER2 TCP_MAXRT TCP_MAXSEG TCP_MD5SIG TCP_NODELAY TCP_NOOPT
index 0690435..3cc90f6 100644 (file)
@@ -32,6 +32,9 @@
 #if defined(I_NETINET_IN) || defined(__ultrix__)
 #  include <netinet/in.h>
 #endif
+#if defined(I_NETINET_IP)
+#  include <netinet/ip.h>
+#endif
 #ifdef I_NETDB
 #  if !defined(ultrix) /* Avoid double definition. */
 #   include <netdb.h>