[Python-Dev] Assign to errno allowed?

Barry Scott barry@barrys-emacs.org
Tue, 24 Sep 2002 20:10:31 +0100

Windows CE prevents assignment to errno...

There would be a solution if you compiled all the code as C++.
(Assuming that C++ reserved words are not used in the python code.)

Inject the following definitions:

	class ErrnoHack
		operator int();	// return errno value
		operator =( int ); // assign to errno

	ErrnoHack ErrnoObject

	#define errno ErrnoObject

and you can then write

	errno = 0;