Staging
v0.5.1
https://github.com/python/cpython
Revision 7b3c03179091e5a849fe0aa9d2ac7290806c36a7 authored by Neal Norwitz on 22 August 2006, 13:57:07 UTC, committed by Neal Norwitz on 22 August 2006, 13:57:07 UTC
1 parent ab7e5ef
Raw File
Tip revision: 7b3c03179091e5a849fe0aa9d2ac7290806c36a7 authored by Neal Norwitz on 22 August 2006, 13:57:07 UTC
Alexander Belopolsky pointed out that pos is a size_t
Tip revision: 7b3c031
generrmap.c
#include <stdio.h>
#include <errno.h>

/* Extract the mapping of Win32 error codes to errno */

int main()
{
	int i;
	printf("/* Generated file. Do not edit. */\n");
	printf("int winerror_to_errno(int winerror)\n");
	printf("{\n\tswitch(winerror) {\n");
	for(i=1; i < 65000; i++) {
		_dosmaperr(i);
		if (errno == EINVAL)
			continue;
		printf("\t\tcase %d: return %d;\n", i, errno);
	}
	printf("\t\tdefault: return EINVAL;\n");
	printf("\t}\n}\n");
}
back to top