From: Steve Hay <SteveHay@planit.com>
Date: Fri, 25 May 2007 09:18:45 +0000 (+0000)
Subject: Fix the ext/IO/t/io_sock.t failure when built with VC++ 2005
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d67249f4ee2e74bfb7d85025c937607c103c9c81;p=p5sagit%2Fp5-mst-13.2.git

Fix the ext/IO/t/io_sock.t failure when built with VC++ 2005

Unknown to me win32/win32.h was defining USE_FIXED_OSFHANDLE, which
arranged for a black magic fix to MSVCRT.DLL's _open_osfhandle() to
be used. It seems that this is inappropriate for VC++ versions later
than 6.x, since they don't use that DLL: simply not defining that
symbol makes the io_sock.t failure go away.

(Compare change #29233, which similarly disabled the fix to
MSVCRT.DLL's read() for VC++ versions later than 6.x.)
p4raw-link: @29233 on //depot/perl: 46e77f111828d72136c91f0837803182535da01d

p4raw-id: //depot/perl@31271
---

diff --git a/README.win32 b/README.win32
index 25ebadd..1a4f7f8 100644
--- a/README.win32
+++ b/README.win32
@@ -410,11 +410,6 @@ spaces.  So don't do that.
 If you are running the tests from a emacs shell window, you may see
 failures in op/stat.t.  Run "dmake test-notty" in that case.
 
-If you're using the Microsoft Visual C++ 2005 compiler (VC++ 8) then you'll
-find that F<ext/IO/t/io_sock.t> currently produces some warnings and then
-hangs.  You will need to kill the hung perl.exe process to allow the
-remainder of the test suite to complete.
-
 If you're using the Borland compiler, you may see a failure in op/taint.t
 arising from the inability to find the Borland Runtime DLLs on the system
 default path.  You will need to copy the DLLs reported by the messages
@@ -960,6 +955,6 @@ Win9x support was added in 5.6 (Benjamin Stuhl).
 
 Support for 64-bit Windows added in 5.8 (ActiveState Corp).
 
-Last updated: 28 November 2006
+Last updated: 25 May 2007
 
 =cut
diff --git a/win32/win32.h b/win32/win32.h
index d0e7d3d..f6b5e3e 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -127,8 +127,11 @@ struct utsname {
 /* Define USE_FIXED_OSFHANDLE to fix MSVCRT's _open_osfhandle() on W95.
    It now uses some black magic to work seamlessly with the DLL CRT and
    works with MSVC++ 4.0+ or GCC/Mingw32
-	-- BKS 1-24-2000 */
-#if (defined(_M_IX86) && _MSC_VER >= 1000) || defined(__MINGW32__)
+	-- BKS 1-24-2000
+   Only use this fix for VC++ 6.x or earlier (and for GCC, which we assume
+   uses MSVCRT.DLL). Later versions use MSVCR70.dll, MSVCR71.dll, etc, which
+   do not require the fix. */
+#if (defined(_M_IX86) && _MSC_VER >= 1000 && _MSC_VER <= 1200) || defined(__MINGW32__)
 #define USE_FIXED_OSFHANDLE
 #endif