mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-22 04:18:30 +00:00
python-3.6.zip added from Github
README.cosmo contains the necessary links.
This commit is contained in:
parent
75fc601ff5
commit
0c4c56ff39
4219 changed files with 1968626 additions and 0 deletions
32
third_party/python/PC/generrmap.c
vendored
Normal file
32
third_party/python/PC/generrmap.c
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
#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");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue