From: Guido van Rossum Date: Fri, 17 Jan 1997 22:05:38 +0000 (+0000) Subject: Fix the _setmode() patch for MS_WINDOWS: include and use X-Git-Tag: v1.5a1~476 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3e7ae7ab173effc320b05a3d5a9fde7eac706771;p=thirdparty%2FPython%2Fcpython.git Fix the _setmode() patch for MS_WINDOWS: include and use fileno(std*). --- diff --git a/Modules/main.c b/Modules/main.c index 15d0cc5ccaf0..789f76456e93 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -37,6 +37,10 @@ PERFORMANCE OF THIS SOFTWARE. #include #endif +#ifdef MS_WINDOWS +#include +#endif + /* Interface to getopt(): */ extern int optind; extern char *optarg; @@ -163,8 +167,8 @@ main(argc, argv) if (unbuffered) { #ifdef MS_WINDOWS - _setmode(stdin, O_BINARY); - _setmode(stdout, O_BINARY); + _setmode(fileno(stdin), O_BINARY); + _setmode(fileno(stdout), O_BINARY); #endif #ifndef MPW setbuf(stdout, (char *)NULL);