mirror of
https://github.com/python/cpython.git
synced 2025-12-09 18:48:05 +00:00
Fix the _setmode() patch for MS_WINDOWS: include <fcntl.h> and use
fileno(std*).
This commit is contained in:
parent
e3258019c8
commit
3e7ae7ab17
1 changed files with 6 additions and 2 deletions
|
|
@ -37,6 +37,10 @@ PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MS_WINDOWS
|
||||||
|
#include <fcntl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Interface to getopt(): */
|
/* Interface to getopt(): */
|
||||||
extern int optind;
|
extern int optind;
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
|
|
@ -163,8 +167,8 @@ main(argc, argv)
|
||||||
|
|
||||||
if (unbuffered) {
|
if (unbuffered) {
|
||||||
#ifdef MS_WINDOWS
|
#ifdef MS_WINDOWS
|
||||||
_setmode(stdin, O_BINARY);
|
_setmode(fileno(stdin), O_BINARY);
|
||||||
_setmode(stdout, O_BINARY);
|
_setmode(fileno(stdout), O_BINARY);
|
||||||
#endif
|
#endif
|
||||||
#ifndef MPW
|
#ifndef MPW
|
||||||
setbuf(stdout, (char *)NULL);
|
setbuf(stdout, (char *)NULL);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue