Staging
v0.5.1
https://github.com/python/cpython
Revision c08cae9fa1b6241a192e0c878877914b000d6ce3 authored by Ezio Melotti on 28 February 2010, 03:48:50 UTC, committed by Ezio Melotti on 28 February 2010, 03:48:50 UTC
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r78513 | ezio.melotti | 2010-02-28 05:46:13 +0200 (Sun, 28 Feb 2010) | 9 lines

  Merged revisions 78511 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r78511 | ezio.melotti | 2010-02-28 05:11:07 +0200 (Sun, 28 Feb 2010) | 1 line

    Pep8ify test names in the examples.
  ........
................
1 parent 1ca73ed
Raw File
Tip revision: c08cae9fa1b6241a192e0c878877914b000d6ce3 authored by Ezio Melotti on 28 February 2010, 03:48:50 UTC
Merged revisions 78513 via svnmerge from
Tip revision: c08cae9
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