summaryrefslogtreecommitdiffstats
path: root/Include/fileobject.h
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-02-11 04:13:06 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-02-11 04:13:06 (GMT)
commitbcd3ea86a39b80b1a3614f4a06a42c0ec7519f0a (patch)
tree1f959941b009fb6b97a1c55db2d579bf8716c59f /Include/fileobject.h
parente4ae63c402c46941ffa62f51050442f794d0f16b (diff)
downloadcpython-bcd3ea86a39b80b1a3614f4a06a42c0ec7519f0a.zip
cpython-bcd3ea86a39b80b1a3614f4a06a42c0ec7519f0a.tar.gz
cpython-bcd3ea86a39b80b1a3614f4a06a42c0ec7519f0a.tar.bz2
Issue #5204: Define _PyVerify_fd on VC6 to make
test_fdopen (test_os.py) pass.
Diffstat (limited to 'Include/fileobject.h')
-rw-r--r--Include/fileobject.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/fileobject.h b/Include/fileobject.h
index 1fed47b..77903be 100644
--- a/Include/fileobject.h
+++ b/Include/fileobject.h
@@ -75,6 +75,9 @@ int _PyFile_SanitizeMode(char *mode);
* Visual Studio 2005
*/
int _PyVerify_fd(int fd);
+#elif defined _MSC_VER && _MSC_VER >= 1200
+/* fdopen doesn't set errno EBADF and crashes for large fd on debug build */
+#define _PyVerify_fd(fd) (_get_osfhandle(fd) >= 0)
#else
#define _PyVerify_fd(A) (1) /* dummy */
#endif