summaryrefslogtreecommitdiff
path: root/PC/generrmap.c
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-09-09 03:35:08 -0600
committerSteve Dower <steve.dower@python.org>2019-09-09 02:35:08 -0700
commit19052a11314e7be7ba003fd6cdbb5400a5d77d96 (patch)
treee4b97c122bf4794d957dff814563b6657ffd0630 /PC/generrmap.c
parent5e5e9515029f70836003a8cfb30433166fcc8db7 (diff)
downloadcpython-git-19052a11314e7be7ba003fd6cdbb5400a5d77d96.tar.gz
bpo-37705: Improve the implementation of winerror_to_errno() (GH-15623)
winerror_to_errno() is no longer automatically generated. Do not rely on the old _dosmapperr() function. Add ERROR_NO_UNICODE_TRANSLATION (1113) -> EILSEQ.
Diffstat (limited to 'PC/generrmap.c')
-rw-r--r--PC/generrmap.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/PC/generrmap.c b/PC/generrmap.c
deleted file mode 100644
index 953344c0d7..0000000000
--- a/PC/generrmap.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <windows.h>
-#include <fcntl.h>
-#include <io.h>
-#include <stdio.h>
-#include <errno.h>
-
-/* Extract the mapping of Win32 error codes to errno */
-
-int main()
-{
- int i;
- _setmode(fileno(stdout), O_BINARY);
- printf("/* Generated file. Do not edit. */\n");
- printf("int winerror_to_errno(int winerror)\n");
- printf("{\n switch(winerror) {\n");
- for(i=1; i < 65000; i++) {
- _dosmaperr(i);
- if (errno == EINVAL) {
- /* Issue #12802 */
- if (i == ERROR_DIRECTORY)
- errno = ENOTDIR;
- /* Issue #13063 */
- else if (i == ERROR_NO_DATA)
- errno = EPIPE;
- else
- continue;
- }
- printf(" case %d: return %d;\n", i, errno);
- }
- printf(" default: return EINVAL;\n");
- printf(" }\n}\n");
-}