annotate PC/generrmap.c @ 54294:dba767bc3155 legacy-trunk

remove mention of old ctypes version
author Benjamin Peterson <benjamin@python.org>
date Sat, 23 May 2009 20:59:09 +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 }