From: minima Date: Fri, 11 Jan 2002 01:38:41 +0000 (+0000) Subject: add missing defined for M$ X-Git-Tag: R_1_50~88 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=532c5c9e14a48ec17d38dce5d904a3b612a2563b;p=spider.git add missing defined for M$ --- diff --git a/perl/Msg.pm b/perl/Msg.pm index 5aef961e..165596d2 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -53,16 +53,13 @@ BEGIN { require Errno; Errno->import(qw(EAGAIN EINPROGRESS EWOULDBLOCK)); }; - unless ($^O eq 'MSWin32') { - if ($] >= 5.6) { - eval { - require Socket; Socket->import(qw(IPPROTO_TCP TCP_NODELAY)); - }; - } else { - dbg("IPPROTO_TCP and TCP_NODELAY manually defined"); - eval 'sub IPPROTO_TCP { 6 };'; - eval 'sub TCP_NODELAY { 1 };'; - } + eval { + require Socket; Socket->import(qw(IPPROTO_TCP TCP_NODELAY)); + }; + unless (*IPPROTO_TCP && !$^O =~ /^MS/) { + dbg("IPPROTO_TCP and TCP_NODELAY manually defined"); + eval '*IPPROTO_TCP = sub { 6 };'; + eval '*TCP_NODELAY = sub { 1 };'; } # http://support.microsoft.com/support/kb/articles/Q150/5/37.asp # defines EINPROGRESS as 10035. We provide it here because some @@ -72,6 +69,8 @@ BEGIN { eval '*EWOULDBLOCK = *EAGAIN = sub { 10035 };'; eval '*F_GETFL = sub { 0 };'; eval '*F_SETFL = sub { 0 };'; + eval '*IPPROTO_TCP = sub { 6 };'; + eval '*TCP_NODELAY = sub { 1 };'; $blocking_supported = 1; } }