summaryrefslogtreecommitdiff
path: root/Include/fileutils.h
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2015-03-06 14:47:02 -0800
committerSteve Dower <steve.dower@microsoft.com>2015-03-06 14:47:02 -0800
commitd81431f587e9eab67db683908548b0ad46847b38 (patch)
tree69bbc1cdda06acab523871f322982b00931a3675 /Include/fileutils.h
parenteef20de744cfdf971d5a80d6e3f9c7f7cb9e14fc (diff)
downloadcpython-git-d81431f587e9eab67db683908548b0ad46847b38.tar.gz
Issue #23524: Replace _PyVerify_fd function with calling _set_thread_local_invalid_parameter_handler on every thread.
Diffstat (limited to 'Include/fileutils.h')
-rw-r--r--Include/fileutils.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/Include/fileutils.h b/Include/fileutils.h
index bb9048116d..95632edb11 100644
--- a/Include/fileutils.h
+++ b/Include/fileutils.h
@@ -108,6 +108,18 @@ PyAPI_FUNC(int) _Py_get_blocking(int fd);
PyAPI_FUNC(int) _Py_set_blocking(int fd, int blocking);
#endif /* !MS_WINDOWS */
+#if defined _MSC_VER && _MSC_VER >= 1400
+/* A routine to check if a file descriptor is valid on Windows. Returns 0
+ * and sets errno to EBADF if it isn't. This is to avoid Assertions
+ * from various functions in the Windows CRT beginning with
+ * Visual Studio 2005
+ */
+int _PyVerify_fd(int fd);
+
+#else
+#define _PyVerify_fd(A) (1) /* dummy */
+#endif
+
#endif /* Py_LIMITED_API */
#ifdef __cplusplus