Change 33526 by [EMAIL PROTECTED] on 2008/03/14 10:17:48
Integrate:
[ 33242]
Cope with differing prototypes for ECONNREFUSED etc on Win32 between
5.8.x and 5.10.x
Affected files ...
... //depot/maint-5.10/perl/lib/Net/Ping.pm#3 integrate
Differences ...
==== //depot/maint-5.10/perl/lib/Net/Ping.pm#3 (text) ====
Index: perl/lib/Net/Ping.pm
--- perl/lib/Net/Ping.pm#2~33113~ 2008-01-29 14:22:25.000000000 -0800
+++ perl/lib/Net/Ping.pm 2008-03-14 03:17:48.000000000 -0700
@@ -16,7 +16,7 @@
@ISA = qw(Exporter);
@EXPORT = qw(pingecho);
-$VERSION = "2.34";
+$VERSION = "2.35";
sub SOL_IP { 0; };
sub IP_TOS { 1; };
@@ -35,11 +35,20 @@
if ($^O =~ /Win32/i) {
# Hack to avoid this Win32 spewage:
# Your vendor has not defined POSIX macro ECONNREFUSED
- *ECONNREFUSED = sub() {10061;}; # "Unknown Error" Special Win32 Response?
- *ENOTCONN = sub() {10057;};
- *ECONNRESET = sub() {10054;};
- *EINPROGRESS = sub() {10036;};
- *EWOULDBLOCK = sub() {10035;};
+ my @pairs = (ECONNREFUSED => 10061, # "Unknown Error" Special Win32 Response?
+ ENOTCONN => 10057,
+ ECONNRESET => 10054,
+ EINPROGRESS => 10036,
+ EWOULDBLOCK => 10035,
+ );
+ while (my $name = shift @pairs) {
+ my $value = shift @pairs;
+ # When defined, these all are non-zero
+ unless (eval $name) {
+ no strict 'refs';
+ *{$name} = defined prototype \&{$name} ? sub () {$value} : sub {$value};
+ }
+ }
# $syn_forking = 1; # XXX possibly useful in < Win2K ?
};
End of Patch.