annotate PC/generrmap.c @ 58925:eecf1bef052d 2.6

Merged revisions 78207 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78207 | ezio.melotti | 2010-02-17 01:26:09 +0200 (Wed, 17 Feb 2010) | 1 line #7930: fix stripid ........
author Ezio Melotti <ezio.melotti@gmail.com>
date Tue, 16 Feb 2010 23:29:44 +0000
parents e2ef60fec3da
children fd25030223b0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38153
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
1 #include <stdio.h>
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
2 #include <errno.h>
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
3
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
4 /* Extract the mapping of Win32 error codes to errno */
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
5
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
6 int main()
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
7 {
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
8 int i;
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
9 printf("/* Generated file. Do not edit. */\n");
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
10 printf("int winerror_to_errno(int winerror)\n");
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
11 printf("{\n\tswitch(winerror) {\n");
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
12 for(i=1; i < 65000; i++) {
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
13 _dosmaperr(i);
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
14 if (errno == EINVAL)
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
15 continue;
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
16 printf("\t\tcase %d: return %d;\n", i, errno);
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
17 }
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
18 printf("\t\tdefault: return EINVAL;\n");
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
19 printf("\t}\n}\n");
e2ef60fec3da Change WindowsError to carry the Win32 error code in winerror,
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
20 }